By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,557 Members | 1,164 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,557 IT Pros & Developers. It's quick & easy.

suggestions in connecting to an access database?

P: 55
Hi everyone,

i'm using an access database and the way i access it is thru an odbc systemdsn. but this time i don't want to use an odbc since when i install the program to other computers i have to keep on setting up the odbc how do i overcome this? any suggestions on what should i use instead?
Nov 27 '07 #1
Share this Question
Share on Google+
3 Replies


P: 6
Hi,

May be you can try using ADODB recordset.
Expand|Select|Wrap|Line Numbers
  1. Dim con As ADODB.Connection
  2. Dim rs As ADODB.Recordset
  3.  
  4. Set rs = New ADODB.Recordset
  5. Set con = New ADODB.Connection
  6. con.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=\\wangmod2\Database\Col AMS.mdb;" & "Jet OLEDB:Database Password=compaq"
  7. con.Open
  8. rs.Open "SELECT Username From Login;", con, adOpenDynamic, adLockOptimistic
  9.  
  10. ...
  11. ....
  12. rs.close
  13. con.close
  14.  
try this and let me know if you face problems.
Nov 27 '07 #2

Expert 100+
P: 487
This type of code, you have to create exe for each time when the database path changed.
Write connection string in text file and read it from there. This will be easy.
Nov 27 '07 #3

P: 55
Thanks a lot you two :D

it really helped me... ;P
Nov 28 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.