Results 1 to 11 of 11

Thread: pointing to Databases :P

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2002
    Posts
    18

    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!

  2. #2
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051
    I think you would have to do it in code...

    i.e.

    VB Code:
    1. 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.


  3. #3

    Thread Starter
    Junior Member
    Join Date
    Apr 2002
    Posts
    18
    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?

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    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)

  5. #5
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051
    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:
    1. 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.


  6. #6

    Thread Starter
    Junior Member
    Join Date
    Apr 2002
    Posts
    18
    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)

  7. #7
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051
    VB Code:
    1. Private Sub Image1_Click()
    2.  
    3. End Sub
    4.  
    5. Private Sub cmdMenu_Click()
    6. Menu.Show
    7. Millennium.Hide
    8. End Sub
    9.  
    10. Private Sub Command1_Click()
    11.     Menu.Show
    12.     Millennium.Hide
    13. End Sub
    14.  
    15.  
    16. Private Sub Form_Load()
    17. [B]ADODC1.DatabaseName = app.path & "\MyFile.mdb"[/B] 'Assuming this is the right property to use
    18. End Sub
    19.  
    20. Private Sub txtcustID_Change()
    21.     Adodc1.RecordSource = "select error from errors where cust_ID= " & txtcustID.Text
    22.     Adodc1.Refresh
    23.     Adodc2.RecordSource = "select part_name from repair where cust_ID= " & txtcustID.Text
    24.     Adodc2.Refresh
    25. 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.


  8. #8
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    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

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Apr 2002
    Posts
    18
    hehe, cheers guys, thanks for helping!

    But, are we sure this is gona work, im gona go try it now tho!

  10. #10

    Thread Starter
    Junior Member
    Join Date
    Apr 2002
    Posts
    18
    Originally posted by mendhak
    Make the following changes to your code:

    ROFL, what did u actually change??


    ahhhhhhhhh quotes

  11. #11

    Thread Starter
    Junior Member
    Join Date
    Apr 2002
    Posts
    18
    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
  •  



Click Here to Expand Forum to Full Width