If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > SQL Syntax error with a float

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-05-02, 14:36
DavidJMoore106 DavidJMoore106 is offline
Registered User
 
Join Date: Nov 2002
Posts: 2
Red face 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
Reply With Quote
  #2 (permalink)  
Old 11-25-02, 04:44
fadace fadace is offline
Registered User
 
Join Date: Nov 2002
Location: Switzerland
Posts: 523
Return us the DDL of your table (on Sybase or MS-SQL, a sp_help YourTable)
Reply With Quote
  #3 (permalink)  
Old 11-26-02, 09:35
DavidJMoore106 DavidJMoore106 is offline
Registered User
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On