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

    Unanswered: Help in create table asap

    I have been working on project and I am creating a table.
    the syntax is like this:

    sql = "CREATE TABLE " & s & "(id number(5),val text (9) )"

    here i am trying to connect to an access databse and i am storing the name of the table in variable s.
    But i get an error which is either field definition error or create table syntax error.Plz help

  2. #2
    Join Date
    Feb 2004
    example (replace source, table name etc):

    Dim adoCon As New ADODB.Connection
    Dim rsPerson As New ADODB.Recordset
    Dim strCon As String

    strTableName = "aaaaa"
    strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\db1.mdb"
    adoCon.Open strCon
    strSQL = "Create table " & tableName & " (id number(5),val text (9))"

    If that doesn't work, try changing the names of the fields to lngID and strVal.

Posting Permissions

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