Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

commondialog.showopen

ryanc2k3ryanc2k3 Member Posts: 28
how can i associate the ADO's connectionstring's datasource with my commondialog.filename, so that if ever my database is misplaced i can search it using the commondialog.showopen. how can i alter the datasource without debugging the program.

Comments

  • GideonOmegaGideonOmega Member Posts: 617
    : how can i associate the ADO's connectionstring's datasource with my commondialog.filename, so that if ever my database is misplaced i can search it using the commondialog.showopen. how can i alter the datasource without debugging the program.
    :
    :
    Have you tried:
    [code]
    commondialog.showopen
    adodc1.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Documents and SettingsDougDesktopProgramingVBcodeExample" & [b]commondialog.FileName[/b] & ";Persist Security Info=False"
    adodc1.refresh
    [/code]

    I havent actually tried changeing a ado data controls connection string at runtime, but try it out and let me know.

    you may have to set the recordsource property as well.
    [blue]
    C:Dos
    C:Dos Run
    Run Dos Run
    [/blue]

  • ryanc2k3ryanc2k3 Member Posts: 28
    : : how can i associate the ADO's connectionstring's datasource with my commondialog.filename, so that if ever my database is misplaced i can search it using the commondialog.showopen. how can i alter the datasource without debugging the program.
    : :
    : :
    : Have you tried:
    : [code]
    : commondialog.showopen
    : adodc1.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Documents and SettingsDougDesktopProgramingVBcodeExample" & [b]commondialog.FileName[/b] & ";Persist Security Info=False"
    : adodc1.refresh
    : [/code]
    :
    : I havent actually tried changeing a ado data controls connection string at runtime, but try it out and let me know.
    :
    : you may have to set the recordsource property as well.
    : [blue]
    : C:Dos
    : C:Dos Run
    : Run Dos Run
    : [/blue]
    :
    :
    okay! thanks a lot for your help, the addnew method works perfectly now. thank u so much!
  • GideonOmegaGideonOmega Member Posts: 617
    : : : how can i associate the ADO's connectionstring's datasource with my commondialog.filename, so that if ever my database is misplaced i can search it using the commondialog.showopen. how can i alter the datasource without debugging the program.
    : : :
    : : :
    : : Have you tried:
    : : [code]
    : : commondialog.showopen
    : : adodc1.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Documents and SettingsDougDesktopProgramingVBcodeExample" & [b]commondialog.FileName[/b] & ";Persist Security Info=False"
    : : adodc1.refresh
    : : [/code]
    : :
    : : I havent actually tried changeing a ado data controls connection string at runtime, but try it out and let me know.
    : :
    : : you may have to set the recordsource property as well.
    : : [blue]
    : : C:Dos
    : : C:Dos Run
    : : Run Dos Run
    : : [/blue]
    : :
    : :
    : okay! thanks a lot for your help, the addnew method works perfectly now. thank u so much!
    :


    No prob, glad I could help.
    [blue]
    C:Dos
    C:Dos Run
    Run Dos Run
    [/blue]

  • ryanc2k3ryanc2k3 Member Posts: 28
    : : : : how can i associate the ADO's connectionstring's datasource with my commondialog.filename, so that if ever my database is misplaced i can search it using the commondialog.showopen. how can i alter the datasource without debugging the program.
    : : : :
    : : : :
    : : : Have you tried:
    : : : [code]
    : : : commondialog.showopen
    : : : adodc1.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Documents and SettingsDougDesktopProgramingVBcodeExample" & [b]commondialog.FileName[/b] & ";Persist Security Info=False"
    : : : adodc1.refresh
    : : : [/code]
    : : :
    : : : I havent actually tried changeing a ado data controls connection string at runtime, but try it out and let me know.
    : : :
    : : : you may have to set the recordsource property as well.
    : : : [blue]
    : : : C:Dos
    : : : C:Dos Run
    : : : Run Dos Run
    : : : [/blue]
    : : :
    : : :
    : : okay! thanks a lot for your help, the addnew method works perfectly now. thank u so much!
    : :
    :
    :
    : No prob, glad I could help.
    : [blue]
    : C:Dos
    : C:Dos Run
    : Run Dos Run
    : [/blue]
    :
    :
    the connectionstring creates an error at runtime "Not A Valid File Name".
  • GideonOmegaGideonOmega Member Posts: 617
    [b][red]This message was edited by Moderator at 2004-4-12 5:18:58[/red][/b][hr]
    : : : : : how can i associate the ADO's connectionstring's datasource with my commondialog.filename, so that if ever my database is misplaced i can search it using the commondialog.showopen. how can i alter the datasource without debugging the program.
    : : : : :
    : : : : :
    : : : : Have you tried:
    : : : : [code]
    : : : : commondialog.showopen
    : : : : adodc1.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Documents and SettingsDougDesktopProgramingVBcodeExample" & [b]commondialog.FileName[/b] & ";Persist Security Info=False"
    : : : : adodc1.refresh
    : : : : [/code]
    : : : :
    : : : : I havent actually tried changeing a ado data controls connection string at runtime, but try it out and let me know.
    : : : :
    : : : : you may have to set the recordsource property as well.
    : : : : [blue]
    : : : : C:Dos
    : : : : C:Dos Run
    : : : : Run Dos Run
    : : : : [/blue]
    : : : :
    : : : :
    : : : okay! thanks a lot for your help, the addnew method works perfectly now. thank u so much!
    : : :
    : :
    : :
    : : No prob, glad I could help.
    : : [blue]
    : : C:Dos
    : : C:Dos Run
    : : Run Dos Run
    : : [/blue]
    : :
    : :
    : the connectionstring creates an error at runtime "Not A Valid File Name".
    :

    my Mistake I forgot that the commondialog.filename returns the entire path so you would replace:
    [code]
    adodc1.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=[b]C:Documents and SettingsDougDesktopProgramingVBcodeExample" & commondialog.FileName[/b] & ";Persist Security Info=False"
    [/code]

    with

    [code]
    adodc1.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="[b] & commondialog.filename & [/b]";Persist Security Info=False"
    [/code]


    Sorry, that should work better.
    [blue]
    C:Dos
    C:Dos Run
    Run Dos Run
    [/blue]



  • ryanc2k3ryanc2k3 Member Posts: 28
    : [b][red]This message was edited by Moderator at 2004-4-12 5:18:58[/red][/b][hr]
    : : : : : : how can i associate the ADO's connectionstring's datasource with my commondialog.filename, so that if ever my database is misplaced i can search it using the commondialog.showopen. how can i alter the datasource without debugging the program.
    : : : : : :
    : : : : : :
    : : : : : Have you tried:
    : : : : : [code]
    : : : : : commondialog.showopen
    : : : : : adodc1.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Documents and SettingsDougDesktopProgramingVBcodeExample" & [b]commondialog.FileName[/b] & ";Persist Security Info=False"
    : : : : : adodc1.refresh
    : : : : : [/code]
    : : : : :
    : : : : : I havent actually tried changeing a ado data controls connection string at runtime, but try it out and let me know.
    : : : : :
    : : : : : you may have to set the recordsource property as well.
    : : : : : [blue]
    : : : : : C:Dos
    : : : : : C:Dos Run
    : : : : : Run Dos Run
    : : : : : [/blue]
    : : : : :
    : : : : :
    : : : : okay! thanks a lot for your help, the addnew method works perfectly now. thank u so much!
    : : : :
    : : :
    : : :
    : : : No prob, glad I could help.
    : : : [blue]
    : : : C:Dos
    : : : C:Dos Run
    : : : Run Dos Run
    : : : [/blue]
    : : :
    : : :
    : : the connectionstring creates an error at runtime "Not A Valid File Name".
    : :
    :
    : my Mistake I forgot that the commondialog.filename returns the entire path so you would replace:
    : [code]
    : adodc1.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=[b]C:Documents and SettingsDougDesktopProgramingVBcodeExample" & commondialog.FileName[/b] & ";Persist Security Info=False"
    : [/code]
    :
    : with
    :
    : [code]
    : adodc1.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="[b] & commondialog.filename & [/b]";Persist Security Info=False"
    : [/code]
    :
    :
    : Sorry, that should work better.
    : [blue]
    : C:Dos
    : C:Dos Run
    : Run Dos Run
    : [/blue]
    :
    :
    :
    :
    thanks, it worked nicely, thank u very much. and your right when you said that you need to alter the recordsource as well. thanks u so much!

  • GideonOmegaGideonOmega Member Posts: 617
    : : [b][red]This message was edited by Moderator at 2004-4-12 5:18:58[/red][/b][hr]
    : : : : : : : how can i associate the ADO's connectionstring's datasource with my commondialog.filename, so that if ever my database is misplaced i can search it using the commondialog.showopen. how can i alter the datasource without debugging the program.
    : : : : : : :
    : : : : : : :
    : : : : : : Have you tried:
    : : : : : : [code]
    : : : : : : commondialog.showopen
    : : : : : : adodc1.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Documents and SettingsDougDesktopProgramingVBcodeExample" & [b]commondialog.FileName[/b] & ";Persist Security Info=False"
    : : : : : : adodc1.refresh
    : : : : : : [/code]
    : : : : : :
    : : : : : : I havent actually tried changeing a ado data controls connection string at runtime, but try it out and let me know.
    : : : : : :
    : : : : : : you may have to set the recordsource property as well.
    : : : : : : [blue]
    : : : : : : C:Dos
    : : : : : : C:Dos Run
    : : : : : : Run Dos Run
    : : : : : : [/blue]
    : : : : : :
    : : : : : :
    : : : : : okay! thanks a lot for your help, the addnew method works perfectly now. thank u so much!
    : : : : :
    : : : :
    : : : :
    : : : : No prob, glad I could help.
    : : : : [blue]
    : : : : C:Dos
    : : : : C:Dos Run
    : : : : Run Dos Run
    : : : : [/blue]
    : : : :
    : : : :
    : : : the connectionstring creates an error at runtime "Not A Valid File Name".
    : : :
    : :
    : : my Mistake I forgot that the commondialog.filename returns the entire path so you would replace:
    : : [code]
    : : adodc1.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=[b]C:Documents and SettingsDougDesktopProgramingVBcodeExample" & commondialog.FileName[/b] & ";Persist Security Info=False"
    : : [/code]
    : :
    : : with
    : :
    : : [code]
    : : adodc1.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="[b] & commondialog.filename & [/b]";Persist Security Info=False"
    : : [/code]
    : :
    : :
    : : Sorry, that should work better.
    : : [blue]
    : : C:Dos
    : : C:Dos Run
    : : Run Dos Run
    : : [/blue]
    : :
    : :
    : :
    : :
    : thanks, it worked nicely, thank u very much. and your right when you said that you need to alter the recordsource as well. thanks u so much!
    :
    :



    No problem, glad I could help.
    [blue]
    C:Dos
    C:Dos Run
    Run Dos Run
    [/blue]

Sign In or Register to comment.