|
-
Apr 25th, 2002, 11:04 AM
#1
Thread Starter
Junior Member
pointing to Databases :P
Right me laddos!
How can i tell an ADODC to look up a database in the current directory of the program.
i believe ive tried ".\main.mdb" , "main.mdb" and "\main.mdb"
BUT I JUST CANT DO IT!!! 
plz help me if u can, cheers!
-
Apr 25th, 2002, 11:07 AM
#2
Not NoteMe
I think you would have to do it in code...
i.e.
VB Code:
msgbox app.path & "\MyFile.mdb"
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
-
Apr 25th, 2002, 11:12 AM
#3
Thread Starter
Junior Member
sorry but whats with the message box?
i have a form, with an ADODC on it, linking to an access database in the background, all i wana do is try and make the address for the database the same as the route for the program, is that how i need to go about it then?
-
Apr 25th, 2002, 11:14 AM
#4
Originally posted by GrImShEePeR
sorry but whats with the message box?
i have a form, with an ADODC on it, linking to an access database in the background, all i wana do is try and make the address for the database the same as the route for the program, is that how i need to go about it then?
Spongebob Squarepants is right.... You have to set it as App.Path & mydatabase.mdb
The messagebox was just a demonstration. I thought it was funny the way you answered him (No off 2 any1)
-
Apr 25th, 2002, 11:15 AM
#5
Not NoteMe
I havn't used an ADODC object before, so i don't know what the property is that points to the actual database file.
If it was 'DatabaseName' (like a data object) then i would use the following in the form_load event.
VB Code:
ADODC1.DatabaseName = app.path & "\MyFile.mdb"
I just did the msgbox thing so you'd get an idea of what app.path returned, sorry if it confused you.
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
-
Apr 25th, 2002, 11:17 AM
#6
Thread Starter
Junior Member
ok so if i have this :
Code:
Private Sub Image1_Click()
End Sub
Private Sub cmdMenu_Click()
Menu.Show
Millennium.Hide
End Sub
Private Sub Command1_Click()
Menu.Show
Millennium.Hide
End Sub
Private Sub Form_Load()
End Sub
Private Sub txtcustID_Change()
Adodc1.RecordSource = "select error from errors where cust_ID= " & txtcustID.Text
Adodc1.Refresh
Adodc2.RecordSource = "select part_name from repair where cust_ID= " & txtcustID.Text
Adodc2.Refresh
End Sub
where am i lookin at putting this?
(sorry i r n00b)
-
Apr 25th, 2002, 11:19 AM
#7
Not NoteMe
VB Code:
Private Sub Image1_Click()
End Sub
Private Sub cmdMenu_Click()
Menu.Show
Millennium.Hide
End Sub
Private Sub Command1_Click()
Menu.Show
Millennium.Hide
End Sub
Private Sub Form_Load()
[B]ADODC1.DatabaseName = app.path & "\MyFile.mdb"[/B] 'Assuming this is the right property to use
End Sub
Private Sub txtcustID_Change()
Adodc1.RecordSource = "select error from errors where cust_ID= " & txtcustID.Text
Adodc1.Refresh
Adodc2.RecordSource = "select part_name from repair where cust_ID= " & txtcustID.Text
Adodc2.Refresh
End Sub
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
-
Apr 25th, 2002, 11:20 AM
#8
Make the following changes to your code:
Adodc1.RecordSource = "select error from errors where cust_ID= '" & txtcustID.Text & "'"
Adodc1.Refresh
Adodc2.RecordSource = "select part_name from repair where cust_ID= '" & txtcustID.Text & "'"
Adodc2.Refresh
-
Apr 25th, 2002, 11:20 AM
#9
Thread Starter
Junior Member
hehe, cheers guys, thanks for helping!
But, are we sure this is gona work, im gona go try it now tho!
-
Apr 25th, 2002, 11:22 AM
#10
Thread Starter
Junior Member
Originally posted by mendhak
Make the following changes to your code:
ROFL, what did u actually change??

ahhhhhhhhh quotes
-
Apr 25th, 2002, 11:30 AM
#11
Thread Starter
Junior Member
can u check for yourselves, i promise its a safe file
(self extracting exe of my program)
http://www.tele2.co.uk/~zerocool/Install_MBS.exe
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
|