Click to See Complete Forum and Search --> : MSDataShape
February 2nd, 2000, 08:25 AM
I want to create a hierarchical recordset but I can't get the MSDataShape provider to work for some reason. I already tried using both MSDataShape and MSDataShape.1 and setting cursor type to client. I always get the message "Data Source not found and default driver not specified." Here is the code:
cnn.CursorLocation = adUseClient
cnn.Provider = "MSDataShape"
stri = "Provider=MSDataShape.1;Data Source=TestDatabase;" & _
"Connect Timeout=15;Data Provider=MSDASQL"
cnn.open stri
February 2nd, 2000, 10:38 AM
First of All the syntax you've used is incorrect
You have
cnn.CursorLocation = adUseClient
cnn.Provider = "MSDataShape"
stri = "Provider=MSDataShape.1;Data Source=TestDatabase;" & _
"Connect Timeout=15;Data Provider=MSDASQL"
cnn.open stri
whereas it should be "connection timeout"
ie.
cnn.CursorLocation = adUseClient
cnn.Provider = "MSDataShape"
stri = "Provider=MSDataShape.1;Data Source=TestDatabase;" & _
"Connection Timeout=15;Data Provider=MSDASQL"
cnn.open stri
I tried this code with a database that I use and it worked fine.
the error message you are getting leads me to believe that you have not set up testdatabase as a DSN in your ODBC settings although I may be wrong.
Hope this helps
February 2nd, 2000, 10:44 AM
Ok, thanks...but if I want to use a native oledb provider I don't need a dsn, right?
February 3rd, 2000, 03:08 AM
I'm sorry of course you're right. I've never used MSDatashape before but the following works for me using OLEDB (I have no DSN's set up)
Dim cnn as ADODB.Connection
set cnn=new ADODB.Connection
cnn.CursorLocation = adUseClient
cnn.Provider = "SQLOLEDB"
With cnn
.ConnectionString = "User ID=sa;Password=;" & _
"Data Source=;" & _
"Initial Catalog="
End With
the Data source is the name of the machine that the database resides on and the initial catalog is the name of the database itself.
Hope this helps.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.