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!
Printable View
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!
I think you would have to do it in code...
i.e.
VB Code:
msgbox app.path & "\MyFile.mdb"
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.mdbQuote:
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?
The messagebox was just a demonstration. I thought it was funny the way you answered him (No off 2 any1)
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. :)
ok so if i have this :
where am i lookin at putting 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
(sorry i r n00b)
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
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
hehe, cheers guys, thanks for helping!
But, are we sure this is gona work, im gona go try it now tho! :D
ROFL, what did u actually change??Quote:
Originally posted by mendhak
Make the following changes to your code:
:D
ahhhhhhhhh quotes
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