|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
dns-less connection w/ no promptI 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!! <stop***@hotmail.com> wrote in message
Show quoteHide quote news:1129838887.085066.277980@g49g2000cwa.googlegroups.com... Here's a sample of opening from an Access database I have (it appears you're > 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? using DAO, altough next time you have a question please specify that instead of making us guess) so it should be similar. I'm not quite sure what you meant by "link my access table," because it looks like you're simply trying to open a connection to an SQL Server, not do any sort of linking (as Access defines linking). Dim wks As DAO.Workspace, cnn As DAO.Connection Set wks = DBEngine.CreateWorkspace("MyODBCWks", "", "", dbUseODBC) Set cnn = wks.OpenConnection("", dbDriverNoPrompt, False, "ODBC;DRIVER={SQL Server};SERVER=MyServer;DATABASE=MyDB;Trusted_Connection=True;") Of course, substitute your values (such as UID and PWD instead of Trusted_Connection, etc.). Oh, and now that I look at it, it could be the missing "ODBC;" from the beginning of your connection string. Jet is picky.... thank you for the recommendation I'll try it at work tommorrow.
I'll tell you if it works friday, morning
Other interesting topics
|
|||||||||||||||||||||||