Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2002
    Posts
    2

    Red face Unanswered: SQL Syntax error with a float

    I am using Visual C++, ATL library(no MFC), and #import "C:\Program Files\Common Files\System\ADO\msado15.dll" \
    no_namespace rename ("EOF","EndOfFile")

    I connect to an Access Database using a udl file

    CoInitialize(NULL);
    //Create the Connection String and set it to the udl file
    // FileName=C:\InControl7.11\NT\Vpr.udl
    _bstr_t m_bstrConnectString("File Name=C:\\InControl7.11NT\\Vpr.udl");
    try
    {
    //open a connection
    ADOHR(pConnection.CreateInstance(__uuidof(Connecti on)));
    pConnection->ConnectionString = m_bstrConnectString;
    ADOHR(pConnection->Open(m_bstrConnectString,"admin","",-1));

    INSERT INTO Pressure (Interval) Values (0.025);


    Microsoft Jet 4.0 returns an error, saying there is a "Syntax error in INSERT INTO Statement"

    I have tried to put the float value in single qoutes ('0.025') and still get a Syntax error any Ideas what I am doing wrong here

  2. #2
    Join Date
    Nov 2002
    Location
    Switzerland
    Posts
    524
    Return us the DDL of your table (on Sybase or MS-SQL, a sp_help YourTable)

  3. #3
    Join Date
    Nov 2002
    Posts
    2

    Cool Found source of problem

    I was using MS-SQL to an Access DB, it seems Interval is some type of keyword, and I had to put [ ] around it to signify it was a table field. Thank-You for responding.

Posting Permissions

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