Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004

    Unanswered: Use Dbase in VB?


    could anybody help me, i am trying to do a a smple conversion in vb, using ado connection. i am trying to create a dbase IV dbf file using an ado connection parameter. (see codes below). but i always end up with an error messgae of "Syntax error in Create Table statement"..

    i would greatly appreciate all your help.



    --------- Codes --------------------
    Private cnr as new adodb.connection

    cnr.Open "Driver={Microsoft dbase driver (*.dbf)};UID=;PWD=;SourceDB=" + cExtractFile + ";SourceType=DBF;Exclusive=No;BackgroundFetch=Yes; Collate=Machine;Null=Yes;Deleted=Yes;"

    cnr.Execute "create table " & cExtractFile & " (account N(8),fanchise N(4),rno C(11),orname C(40),notes C(25),trandate D,trantime C(8),deposit N(6),ptype C(2),branch C(6),thru C(6),bank C(10),chkno C(16),dochk D,amount N(16),user C(5),package C(3),posted L,xbilling L,scposted L,withsc L,scpay L,total N(16))"

    -------- End Code -----------------

  2. #2
    Join Date
    Oct 2003


    Instead of passing the complicated string expression to the Open and Execute methods directly, put them first into a string variable so that you can display what it actually says.

    You may be, and probably are, omitting a double-quote somewhere. This is by far the fastest way to debug it.
    ChimneySweep(R): fast, automatic
    table repair at a click of the

Posting Permissions

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