执行:Dim strcon As String = ConfigurationManager.ConnectionStrings("SHConsignmentConnectionString").ConnectionString
Dim con As SqlConnection = New SqlConnection(strcon)
con.Open()
Dim cmd As SqlCommand = New SqlCommand()
cmd.Connection = con
cmd.CommandText = "insert into SALESTABLE (INVOICEACCOUNT) select (din_no) from openrowset('MSDASQL','Driver=Microsoft Visual FoxPro Driver;SourceType=DBF;SourceDB=D:\hkpos\hkpos','select * from INV.DBF')"
cmd.ExecuteNonQuery()
con.Close()
con.Dispose()
出错提示:Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "(null)".
OLE DB provider "MSDASQL" for linked server "(null)" returned message "[Microsoft][ODBC Driver Manager] Driver does not support this function".
请问怎会这样,解决办法!??!~?路过的高人,请教~
我告诉你个方法,你通过Visual Stdio 的服务器资源管理器,添加一个DBF数据源,然后你打开一个表,在里面执行插入等操作,也可以通过sql执行,看看能否成功.
文件名称写完整。加上后缀试试。