Results 1 to 3 of 3

Thread: how to patch a database

  1. #1

    Thread Starter
    Fanatic Member Navarone's Avatar
    Join Date
    Jun 2003
    Location
    Akron, Ohio USA
    Posts
    740

    how to patch a database

    I have a situation that requires me to update the database without losing any user information. I need to add a new table and add 2 fields to an existing table.

    Can I do this using some sort of vb script when my application runs?

    I am open to any ideas!
    He who never made a mistake never made a discovery?

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: how to patch a database

    You can execute Create Table and Alter Table sql statements against the database. The syntax would depend on which database you are using.

    What data access technology are you using in your app, DAO or ADO?

  3. #3

    Thread Starter
    Fanatic Member Navarone's Avatar
    Join Date
    Jun 2003
    Location
    Akron, Ohio USA
    Posts
    740

    Re: how to patch a database

    I am using MS Access Database with ADO.
    This is how I am connecting to my db.

    VB Code:
    1. Sub CreateConnection(objConn As Connection)
    2.  
    3. ' CONNECTION STRING FOR THE DATABASE
    4.     AccessConnect = "DRIVER={Microsoft Access Driver (*.mdb)};" & _
    5.                     "DBQ=Westfield.MDB;" & _
    6.                     "DefaultDir=" & App.Path & ";"
    7.  
    8.     'MsgBox AccessConnect
    9.  
    10.     ' Create Connection Object and open it
    11.     Set objConn = New ADODB.Connection
    12.  
    13.     objConn.CursorLocation = adUseClient
    14.  
    15.     ' Trap any error/exception
    16.     On Error GoTo AdoError
    17.  
    18.     objConn.ConnectionString = AccessConnect
    19.     objConn.Open
    20.  
    21.     Exit Sub
    22.  
    23.     ' ADO Error/Exception Handler
    24. AdoError:
    25.     ErrNumber = Err.Number
    26.     ErrSource = Err.Source
    27.     ErrDescription = Err.Description
    28.  
    29.     'AdoErrorEx List1, objConn
    30.  
    31. End Sub
    He who never made a mistake never made a discovery?

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