I have a problem trying to link my access table using VB
I can connect using the below connection string ...
Driver={SQL
Server};SERVER=MYSERVER;UID=MYUSERNAME;PWD=myPASSWORD;DATABASE=myDATABASE;
WHEN I USE...
Set dbsODBC = OpenDatabase("",False, False, strConnect)
BUT IF I try to disable the prompt using...
Set dbsODBC = OpenDatabase("", dbDriverNoPrompt, False, strConnect)
AND
Set dbsODBC = OpenDatabase("", dbDriverNoPrompt, False,"ODBC;" &
strConnect)
my connection either does not connect or it displays the prompt. I
think the problem has something to do with me not using a DSN, but I
thought I should be able to connect without one. PLEASE HELP!
What am I doing wrong, and why would this be happening?
THANK YOU!!I don't understand your question. Open Database is a method of the Jet
database engine (DAO) used with Microsoft Access, not SQL Server. The
connection string you are using is not the correct syntax for the DAO
OpenDatabase method. If you're trying to open an Access database that has a
table in it that is linked to SQL Server, then the linked table has to have
the DSN-less connection string in it's Connect property and you need to use
the syntax for DAO as the parameter to the OpenDatabase function. But, I'm
having a hard time figuring out why you would want to do this? To connect to
a SQL Server DB from VB you should be using ADO (ActiveX Data Objects). The
connection string you are using *is* the correct syntax for the ADO
Connection object's Open method. No need for Jet or Access at this point.
<stoppal@.hotmail.com> wrote in message
news:1129838783.819043.87440@.o13g2000cwo.googlegroups.com...
> I have a problem trying to link my access table using VB
>
> I can connect using the below connection string ...
>
> Driver={SQL
> Server};SERVER=MYSERVER;UID=MYUSERNAME;PWD=myPASSWORD;DATABASE=myDATABASE;
>
> WHEN I USE...
>
> Set dbsODBC = OpenDatabase("",False, False, strConnect)
>
> BUT IF I try to disable the prompt using...
>
> Set dbsODBC = OpenDatabase("", dbDriverNoPrompt, False, strConnect)
> AND
> Set dbsODBC = OpenDatabase("", dbDriverNoPrompt, False,"ODBC;" &
> strConnect)
>
> my connection either does not connect or it displays the prompt. I
> think the problem has something to do with me not using a DSN, but I
> thought I should be able to connect without one. PLEASE HELP!
>
> What am I doing wrong, and why would this be happening?
>
> THANK YOU!!
>|||thank you for the recommendation I'll try it at work tommorrow.
I'll tell you if it works friday, morning|||GOT IT WORKS, THANK YOU!!!!!!!!!!!!!!!!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment