|
-
March 21st, 2001, 12:55 AM
#1
Database
I am making a Database and the database file is in the same folder as all of the forms. Where is the properties box do I put the path to the file of the data base?
-
March 21st, 2001, 08:37 AM
#2
Re: Database
In the properties you can enter the full path of the database. But it is much better to assign path in the run time using App.Path & "\mydb.mdb". That will help you if you install this application to the different folder on the user machine.
Iouri Boutchkine
[email protected]
-
March 21st, 2001, 11:55 AM
#3
Re: Database
Where in the properties do I put the path? I am putting the data base in the same folder as the VB program so where would I put the code you suggested? I noticed you had your Email address on your reply, can I email you a sequential file program that I am have problems with. If I post all the code it will just be a mess on the forum. I can send you all the forms so you can compile it. The problem is only in the main form. I always give 10 for any help I get.
-
March 21st, 2001, 01:00 PM
#4
Re: Database
If you are using ADODC then that is the place where you enter db path (to the adodc properties). If you don't use adodc then the only place where you define the db path is the connection string
Dim sConn As String
Dim cn as ADODB.Connection
dim sDBName as String
Set cn = New ADODB.Connection
sDBNAme = App.Path & "\YourDB.mdb"
sConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & sDBName & ";Persist Security Info=False"
cn.ConnectionString = sConn
cn.Open sConn
Iouri Boutchkine
[email protected]
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
|