SELECT *
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\test.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...xactions
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\test.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...xactions
解决方案 »
- 简单 问题 下班结帖!!
- 求一SQL语句 关于上一条,下一条信息
- 急问怎样查找数据的问题,请大侠帮忙
- ◎请教◎如何使用sql语句实现类似foxmail的按名字首字母查询检索呢?
- 批语句中使用RAISERROR抛出异常,应用程序不能捕捉
- 请教对比2张表,并更新其中一张表
- sql计算字段
- 请教数据库高手:在应用程序中,是使用一个全局的ADODB.Connection好呢,还是每次操作数据表时,使用一个局部的ADODB.Connection好呢?
- 一个有关QQ的数据库问题!
- mysql报警告!No data - zero rows fetched, selected, or processed
- SQLSe rver如何把Timestamp类型字段转换成16进制字符串?或者其它
- 怎么搞数据设计,要注意什么啊,请大家指点啊!(SQL2000)
You can run a Data Transformation Services (DTS) package that has been saved by one of the DTS tools as a Microsoft® Visual Basic® file. The saved module, a Visual Basic .bas file, consists of declarations and a Sub Main and may contain other Subs called by Sub Main. The Subs contain all the logic of the DTS package.Here are the basic steps for incorporating a Visual Basic module file into a Visual Basic project and executing it on a computer running the Microsoft SQL Server™ client tools: 1.In Visual Basic, create a new Standard EXE project.
2.On the Project menu, click References, and then select the Microsoft DTSDataPump Scripting Object Library, Microsoft DTSPackage Object Library, and Microsoft DTS Custom Tasks Object Library check boxes.
Not all DTS programs will require all three of these libraries. 3.On the Project menu, click Add File, and then add the Visual Basic file produced by the DTS Import/Export Wizard or DTS Designer.
4.In the Project Explorer, select Form1 and then on the Project menu, click Remove Form1 to remove the blank form from the Project.
5.Run the project.
No indication of completion will be given other than the Visual Basic Development Environment will go back to design mode.You may want to add completion notification and error handling and controls to allow the user to invoke the transformation.
Dim objPackage As DTS.Package2
Dim objStep As DTS.Step
Dim objTask As DTS.Task
Dim objExecPkg As DTS.ExecutePackageTask
Set objPackage = New DTS.Package
objPackage.FailOnError = True
Set objStep = objPackage.Steps.New
Set objTask = objPackage.Tasks.New("DTSExecutePackageTask")
Set objExecPkg = objTask.CustomTask
With objExecPkg
.PackagePassword = ""
.FileName = S
.Name = "ExecPkgTask"
End With
With objStep
.TaskName = objExecPkg.Name
.Name = "ExecPkgStep"
.ExecuteInMainThread = True
End With
objPackage.Steps.Add objStep
objPackage.Tasks.Add objTask
objPackage.Execute
Set objExecPkg = Nothing
Set objTask = Nothing
Set objStep = Nothing
Set mobjPkgEvents = Nothing
objPackage.UnInitialize
End Sub
设计时声明一下,以上程序改一下即可。