Results 1 to 2 of 2

Thread: Question about SQL Syntax... HELPPPP

  1. #1

    Thread Starter
    Fanatic Member Wen Lie's Avatar
    Join Date
    Jul 1999
    Location
    Singapore
    Posts
    524

    Unhappy

    Dear All...

    I've got a problem with my SQL Syntax. Here is my problem. I'm trying to open a database view with date as criteria. My SQL Syntax is below :

    strSql = "select style, pl_no, date, time, worker, mproc, ename, qty from UNDKT where date = #" & Tanggal & "#"

    myDbf.Open strSql, DbfCon, adOpenKeyset, adLockOptimistic, adCmdText

    or

    strSql = "select style, pl_no, date, time, worker, mproc, ename, qty from UNDKT where date = datevalue(" & Tanggal & ")"

    myDbf.Open strSql, DbfCon, adOpenKeyset, adLockOptimistic, adCmdText


    For your information, UNDKT is my table in DBF format file. If I run my statement above on VB environment, an error will occured :

    [Microsoft][ODBC dBase Driver]Unexpected error from external database driver(10019)

    Could you guys explain to me why ??? If I made mistakes in my SQL statement, would you help me ASAP to correct it ???

    Thx a lot,
    BRgds,
    Wen Lie
    Regards,
    [-w-]

  2. #2
    Lively Member
    Join Date
    Nov 1999
    Location
    Belgium
    Posts
    98
    Hi

    You could try this ...


    dim MyDBF as DAO.DataBase, MyRsDBF as DAO.Recordset, MySQL as String

    MySQL = Your SQL-Statement

    Set MyDBF = Workspaces(0).OpenDatabase("c:\MyPath", False, False, "dBASE IV;")
    Set MyRsDBF = DBCapsugel.OpenRecordset(MySQL)

    R@emdonck

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