Results 1 to 4 of 4

Thread: ODBC problem

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Belgium
    Posts
    98

    Post

    Hi,

    Private Sub stored_procedure_ODBC()


    Dim str_SQL, Connect$, int_teller, db_data, rs_data


    str_SQL = "select * from dbo.vj_bc1_gft_prp_001"


    Connect$ = "ODBC;DSN=global;UID=report;PWD=report;DATABASE=global;"
    Set db_data = OpenDatabase("GLOBAL", False, False, Connect$)
    Set rs_data = db_data.OpenRecordset(str_SQL, dbOpenDynaset, dbSeeChanges)


    rs_data.MoveLast
    int_teller = rs_data.RecordCount

    MsgBox int_teller


    End Sub

    this code gives me a problem !! In the SQL statement (the name of the table) there is a dot. (dbo DOT vj_bc1_gft_prp_001) and for that the code doesn't work!! RUN TIME ERROR 3024 Couldn't find file 'C:\...\dbo.mdb'

    Who can fix this ??


    R@emdonck

  2. #2
    Lively Member Ishamel's Avatar
    Join Date
    Nov 1999
    Location
    Edinburgh, Scotland
    Posts
    112

    Post

    Try removing the dbo. from your SQL statement.

    I tried it on an SQL Server database and it worked fine.

    Hope it works.

    ------------------
    Ishamel
    [email protected]


  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Belgium
    Posts
    98

    Post

    Hi,

    No, it does not work. I get an ODBC failure.

    Sorry

    R@emdonck

  4. #4
    Lively Member Ishamel's Avatar
    Join Date
    Nov 1999
    Location
    Edinburgh, Scotland
    Posts
    112

    Post

    Try replacing this

    Code:
    Set db_data = OpenDatabase("GLOBAL", False, False, Connect$)
    with this

    Code:
    Set db_data = OpenDatabase("", False, False, Connect$)

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