VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

dbconnect vs Windows odbc connection

3 REPLIES 3
Reply
Message 1 of 4
zale-86
686 Views, 3 Replies

dbconnect vs Windows odbc connection

Im connecting to an SQL Express server which is remote.

I currently am using the windows Data sources (ODBC) utility to establish the connection however it is a bit slow.
I'm wondering if I were to use the built-in feature dbconnect if the transactions would be quicker. Here is the problem:

I open dbconnect and create a connection to the database with no problem. I can look at the tables etc from within the dbconnect utility.

I'm trying to use this connection to run queries from within a VBA application in AutoCAD. I can't seem to find the right connection string. Here is my latest attempt:

 

    Set myConnection = New Connection
    myConnection.Open "Provider=Microsoft OLE DB Provider For SQL Server; Data Source=xxxx;" & _
    "UID=xxxx;" & _
    "PWD=xxxx"

 

[DBNETLIB][ConnectionOpen (Connect().]SQL Server does not exist or access denied.

 

Since I can connect directly through dbconnect the problem must be with my connection string. Can anyone help?

 

TIA

 

3 REPLIES 3
Message 2 of 4
Hallex
in reply to: zale-86

Try conection string like this, not sure about

if this helps with your settings though:

 

 connString = "Data Source=User\\SQLEXPRESS;Initial Catalog=XXX;Integrated Security=True;"

Or
connString = "Data Source=.\\SQLEXPRESS;Database=XXX.mdb;Persist Security Info=True;user id=XXX;password=;"

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 3 of 4
zale-86
in reply to: Hallex

Not it.

This is  remote SQL server so there has to be a data source. I'm trying to use the data source I've set up within dbconnect.

Thanks though

Message 4 of 4
Hallex
in reply to: zale-86

Sorry, I'm never worked with remote connection,

try to search for an answer on this branch^

http://forums.autodesk.com/t5/ASE-SQL-OLE-ADE/bd-p/16

_____________________________________
C6309D9E0751D165D0934D0621DFF27919

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost