473,385 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

suggestions in connecting to an access database?

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
3 1084
Muiz
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
CyberSoftHari
487 Expert 256MB
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
jaz215
55
Thanks a lot you two :D

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

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

Similar topics

4
by: John Morgan | last post by:
I have Enterprise Manager on my local machine. For the last twelve months it has been connecting without problem to my online SQL Server database provided by my ISP. Three weeks ago the ISP...
12
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed...
1
by: Salad | last post by:
If one distributes a front/backend app is there a good practice for refreshing the links? I was thinking that the first time the user enters the app, it could check for any tables. If the...
1
by: hk777 | last post by:
Hi I have Access 2007 installed at work, and last week it suddenly started asking me for a username and password whenever I try to open anything, even a new database. If I log in to my computer...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.