Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create Connection Problem (With OLEDB)
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Create Connection Problem (With OLEDB)
Miscellaneous
Thread ID:
00565686
Message ID:
00565686
Views:
59
Using the VFP7 OLEDB provider, I am trying to create an ODBC connection on a database for pulling in a remote view. In the VFP IDE, I can do this in the command window and I can immediately see the connection in the list:
Create Connection ConnDummy01 ConnString "Driver={SQL Server};Server=sqlbeta;Database=lookup1;UID=uid;PWD=pwd"



But this does not work from VBScript:
Set oCacheConn = WScript.CreateObject("ADODB.Connection")
With oCacheConn
.ConnectionString = "Provider=VFPOLEDB.1;Data Source=c:\my.dbc"
.CursorLocation = 2 ' adUseServer
.Mode = 16 ' adModeShareDenyNone
.Open
End With
cExecString = "Create Connection ConnDummy01 ConnString " &Chr(34)& "Driver={SQL Server};Server=sqlbeta;Database=lookup1;UID=uid;PWD=pwd" & Chr(34)
WScript.Echo cExecString
oCacheConn.Execute(cExecString)
Next
Reply
Map
View

Click here to load this message in the networking platform