|
-
Jul 20th, 1999, 08:30 PM
#1
Thread Starter
Hyperactive Member
I am trying to connect my VB app to an Access 97 db, A:\Elements.dat.
My code is this:
Code:
Dim strTemp
strTemp = App.Path
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source = " & strTemp & "Elements.dat"
Adodc1.RecordSource = "Elements"
Adodc1.CursorType = adOpenStatic
When I try to connect, I get no errors, but no connection, either...
My app & my DB are in the same directory. The DB is named with an extension of .DAT to keep users from snooping. I've tested the name thing with another app & it worked fine...
I'm stumped. Any ideas?
Thanks!!
My work E-mail has been tempermental lately, so please feel free to use [email protected] Thanks!!
Also, the only reason I'm trying to connect this way, rather than at design time is that I am unsure where the user will install and want to be flexible...If you know how to code it for a design-time connection, and allow user to install wherever they want, please let me know.
[This message has been edited by rockies1 (edited 07-21-1999).]
-
Jul 21st, 1999, 12:14 AM
#2
Lively Member
Hi,
Try using:
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source = " & strTemp & "\Elements.dat"
You are missing a backslash in your path.
HTH,
Preeti
-
Jul 21st, 1999, 12:24 AM
#3
Thread Starter
Hyperactive Member
I got so frustrated over what I would consider a simple problem, I changed over to a standard data control. When it still didn't work I used your suggestion and it worked!!
One thing I found...If it is installed at the root of a drive, it didn't need the \ but if it wasn't at the root, it did.
I went around it like this:
Code:
If Right(App.Path, 1) = "\" Then
Data1.DatabaseName = App.Path & "Elements.dat"
Else
Data1.DatabaseName = App.Path & "\Elements.dat"
End If
Thanks for the help!!
PS: What is the difference between Member and Junior Member here?
-
Jul 21st, 1999, 12:46 AM
#4
Lively Member
I have no idea and I am trying to figure out when I became a member
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
|