|
-
Dec 7th, 2002, 08:39 AM
#1
Thread Starter
Addicted Member
simple question from a newbie
I am learning to code databases without the use of datacontrols.
I have an access db called calibrations in the following path
c:\CALIBRATIONS.mdb
using the code below how can i incorporate my database path in the <" & App.Path & "\Data1.mdb;" > section
using Data Source=" c:\CALIBRATIONS.mdb;" deosnt work.
conConn.ConnectionString= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Data1.mdb;"
-
Dec 7th, 2002, 10:12 AM
#2
Member
What's your question? It looks like you're trying to use ADO is this correct? What are you trying to accomplish?
-
Dec 7th, 2002, 10:29 AM
#3
Thread Starter
Addicted Member
In the past i have used data controls using vis data. However, these have become problematic as i have many tables and queries, as a result i have been given a code example to mimic the data control. I have been given code to make a connection to ms Access Database in Access 2000 format. But i dont know how to substitute my database in the the following example..
data source =" & App.Path & "\Data1.mdb;"
Deos the 'App.Path' refer to my database name and path?, and what deos 'Data1.mdb' refer to?
Hope this helps
-
Dec 7th, 2002, 10:57 AM
#4
Member
App.Path is the path to your VB application, Data1.mdb is the name of the database.
If you use
app.path & "databasename.mdb"
in your connection string your database must reside in the same folder as your application.
-
Dec 7th, 2002, 10:59 AM
#5
PowerPoster
App.Path refers to the file of your Executable. If you are running the code through the VB environment, it will return the path to the project file(vbp).
Mdb file is the database file that you are using.
Where exactly is your MDB file stored? In the applications directory of in the "c:\".
In case it si in hte C:\ you should rather use
VB Code:
conConn.ConnectionString= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "Data1.mdb;"
otherwise if the database is in with executable/project, then the one you are using should work fine.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|