Results 1 to 2 of 2

Thread: Dynamin COnnection String

  1. #1

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    Dynamin COnnection String

    I am developing a front-end for an access database.

    Because the database will be on a server I need to, after installation, find where the database is and store the connection string in a text file.

    When the application is run it reads the text file and stores the text file in a global "CONNSTRING".

    I have managed to do this but am not sure where to add the "CONNSTRING" global in my code.

    Should all of these:
    Me.OleDbDeleteCommand1.Connection = Me.OleDbConnection1
    Me.OleDbSelectCommand1.Connection = me.OleDbConnection1
    Me.OleDbInsertCommand1.Connection = Me.OleDbConnection1

    Read:
    Me.OleDbDeleteCommand1.Connection = CONNSTRING
    Me.OleDbSelectCommand1.Connection = CONNSTRING
    Me.OleDbInsertCommand1.Connection = CONNSTRING

    Another problem I have is that when running my program I get build errors because CONNSTRING contains nothing until run time.

    I am new to this VB.Net and am finding these database issues difficult to get my head around.

    Thanks in Advance

    Parksie

  2. #2
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    Dbconnection does not seem to be the same thing as connection String. Check this out, has a code snip that looks like it's up your alley, hope it helps:

    ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfsystemdataoledboledbconnectionclasstopic.htm

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