+ Reply to Thread
Results 1 to 2 of 2

How working with Access Databases through Excel 2003 Standar Editi

  1. #1
    Dennis
    Guest

    How working with Access Databases through Excel 2003 Standar Editi

    Hello

    I have troubles when work with databases through VBA Codes in Excel 2003
    Standar Edition. How or what is the way to do?

    Also, the instruction chr(13) not is acceptable in VBA Codes of Excel 2000
    or 2003 Standar Edition.

    My example:


    Dim cnn As New ADODB.Connection
    Set cnn = New Connection
    dbName = ("C:\Data\MYDataBase1.mdb")
    With cnn
    .Provider = "Microsoft.Jet.OLEDB.4.0"
    .Mode = adModeWrite
    .Properties("Jet OLEDB:Database Password") = "abc"
    .Open dbName
    End With

    'Create the recordset
    Dim rs As ADODB.Recordset
    Set rs = New Recordset

    'Determines what records to show
    Dim strSQL As String
    strSQL = "DROP TABLE MYTABLE;"

    'Retreive the records
    rs.CursorLocation = adUseClient
    rs.Open strSQL, cnn

    'close connection
    cnn.Close
    Set cnn = Nothing
    Set rs = Nothing


  2. #2
    Dave Patrick
    Guest

    Re: How working with Access Databases through Excel 2003 Standar Editi

    1.) Show us what you're doing and tell us what happens when you try.

    2.) Give this a go.

    Dim cnn As ADODB.Connection
    Dim strSQL As String
    Set cnn = New ADODB.Connection
    cnn .Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source='C:\Data\MYDataBase1.mdb'"
    strSQL = "DROP TABLE MYTABLE;"
    cnn.Execute strSQL
    cnn.Close
    Set cnn= Nothing


    --
    Regards,

    Dave Patrick ....Please no email replies - reply in newsgroup.
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    http://www.microsoft.com/protect

    "Dennis" wrote:
    | Hello
    |
    | I have troubles when work with databases through VBA Codes in Excel 2003
    | Standar Edition. How or what is the way to do?
    |
    | Also, the instruction chr(13) not is acceptable in VBA Codes of Excel 2000
    | or 2003 Standar Edition.
    |
    | My example:
    |
    |
    | Dim cnn As New ADODB.Connection
    | Set cnn = New Connection
    | dbName = ("C:\Data\MYDataBase1.mdb")
    | With cnn
    | .Provider = "Microsoft.Jet.OLEDB.4.0"
    | .Mode = adModeWrite
    | .Properties("Jet OLEDB:Database Password") = "abc"
    | .Open dbName
    | End With
    |
    | 'Create the recordset
    | Dim rs As ADODB.Recordset
    | Set rs = New Recordset
    |
    | 'Determines what records to show
    | Dim strSQL As String
    | strSQL = "DROP TABLE MYTABLE;"
    |
    | 'Retreive the records
    | rs.CursorLocation = adUseClient
    | rs.Open strSQL, cnn
    |
    | 'close connection
    | cnn.Close
    | Set cnn = Nothing
    | Set rs = Nothing
    |



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1