Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2004
    Posts
    18

    Unanswered: Access database on server

    As the title implies, i have a vb program that has 60+ forms and the database for the data controls is on a server. To run it locally I would have to manually mod all forms with the dc, however, this is not feasible. The dc's that use the database name property are all named the same regardless of the form on which it is on.

    1. How do I use the servers dbase when I run the app locally?
    Create a connection object on the startup form?

    Thanks...

  2. #2
    Join Date
    Nov 2004
    Posts
    108

    You should never hold database connections as data members

    You should never keep a connection longer than the life of the procedure that uses the connection because of performance issues (network traffic, connection pooling, locks, etc.)

    You should always try to connect late and disconnect early.

    I usually save a string to store the connection string as a global variable and set the connection's connectionString to that variable. Since you are using DC it might be good that you search on Disconnected Recordsets (recordsets where connection is set to Nothing)

    How to connect to a server DB?
    see http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=41747 and
    http://www.dbforums.com/t1067471.html
    to err is human ; to really mess things up requires a computer

  3. #3
    Join Date
    Oct 2004
    Location
    In cousin's house
    Posts
    303
    With Cn
    .Open "driver={Driver do Microsoft dBase (*.dbf)}; dbq=h:\path"
    End With

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •