Wrox Home  
Search P2P Archive for: Go

  Return to Index  

activex_data_objects thread: VB, MS Access, And Windows 2000


Message #1 by "Esteban Martinez" <mae_martinez@h...> on Thu, 28 Mar 2002 20:54:23
I've got a couple questions that I need help with.

1) How do I connect to a MS Access Database through windows 2000. In 
win95/98, I would go to the control panel and enter in some info at some 
ADO button thing that I have forgotten about, and it would work through vb 
with the following code:

   dim cn as variant
   dim rs as variant
   dim sql as string

   set cn = createobject("adodb.connection")
   set rs = createobject("Adodb.recordset")
   sql = "select * from nmes"

   cn.open "namelist"   <--- this DSN was entered through the above method
   rs.open sql, cn
 
   'code using the database
   rs.close
   cn.close

But in windows 2000 pro, I dont even have to option to make a connection 
through the control panel. I seen some info about making a .udl file, but 
it didnt have enough information on how to do this correctly, if this is 
the way that I have to make the connection, someone please email me the 
directions.

2) My second question is is there a way in VB to just make a connection to 
the database?... because if I make a program, the user (other than me), 
has to go into the control panel and add the DSN, or however in Win2000. I 
just want to be able to connect to the database that is within the same 
folder as the program, so a lamen computer user can still use the program 
fresh without having to make the DSN connection themselves...


If someone can please answer these questions for me, please email them to 
me at mae_martinez@h...

  Return to Index