473,387 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

SQL 6.5 with Delphi 1.0 on Win95 problem.

Hello,
I have a situation where I have to run a Delphi 1.0 application on
Win95 via ODBC to MS-SQL 6.5 server. This is working for me on
several workstations.
I always install 16-bit BDE and make appropriate changes to odbc*.INI
files, etc.
I have a machine which has just now been setup for this situation -
and at the same time converted to a wireless network card.

Everything works great as far as network connection, running querys,
etc. But when get to the point of saving a transaction - I am getting
the message:
"Error - EDBEngineError(General SQL error. [Microsoft]{ODBC SQL Server
Driver][SQL Server]Line 2: Incorrect syntax near 'DATE_TIME')

Here is the sql statement and partial source code:

sql.Add('INSERT INTO INVOICES (INVOICE_NO, TOTAL, TAX, VOID_CODE,
TYPE_CODE,');
SQL.Add('invoices."DATE_TIME", TERM_NUMB, USER_NUMB, CUSTOMERID,
BATCH)');
SQL.Add('VALUES (:xINVOICE_NO, :xTOTAL, :xTAX, :xVOID_CODE,
:xTYPE_CODE,');
SQL.Add(':xDATE_TIME,'+':xTERM_NUMB, :xUSER_NUMB, :xCustomerID,
:xBATCH)');
ParamByName('xINVOICE_NO').AsString := InvoiceTotals.InvoiceNumber;
ParamByName('xTOTAL').AsFloat := InvoiceTotals.Total;
ParamByName('xTAX').AsFloat := InvoiceTotals.Tax;
ParamByName('xVOID_CODE').AsString := vcFinalized;
ParamByName('xTYPE_CODE').AsString := InvoiceTotals.TypeCode;
ParamByName('xDATE_TIME').AsDateTime := InvoiceTotals.DateTime;
ParamByName('xTERM_NUMB').AsInteger :=
FUseStation;{InvoiceTotals.StationNumb;}
ParamByName('xUSER_NUMB').AsInteger := InvoiceTotals.UserNumb;
ParamByName('xCUSTOMERID').AsString := InvoiceTotals.CustomerID;
ParamByName('xBATCH').AsString := DateToFieldStr(FUseBatch);
ExecSQL;

I realize DATE_TIME is some sort of reserved word but in this context
(ie. table name and quotes) it works on all other stations. This is
the first part of a two part SQL transaction.

What could be wrong?
Thanks - Scott Murray.
Jul 20 '05 #1
3 1644
Since the error is pointing to the second line of your SQL statement, you
might try removing the table name prefix from the DATE_TIME column line the
example below. There may be issues with your ancient ODBC/BDE drivers and
the redundant table name.

SQL.Add('"DATE_TIME", TERM_NUMB, USER_NUMB, CUSTOMERID,BATCH)');

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Scott Murray" <sc****@cland.net> wrote in message
news:12*************************@posting.google.co m...
Hello,
I have a situation where I have to run a Delphi 1.0 application on
Win95 via ODBC to MS-SQL 6.5 server. This is working for me on
several workstations.
I always install 16-bit BDE and make appropriate changes to odbc*.INI
files, etc.
I have a machine which has just now been setup for this situation -
and at the same time converted to a wireless network card.

Everything works great as far as network connection, running querys,
etc. But when get to the point of saving a transaction - I am getting
the message:
"Error - EDBEngineError(General SQL error. [Microsoft]{ODBC SQL Server
Driver][SQL Server]Line 2: Incorrect syntax near 'DATE_TIME')

Here is the sql statement and partial source code:

sql.Add('INSERT INTO INVOICES (INVOICE_NO, TOTAL, TAX, VOID_CODE,
TYPE_CODE,');
SQL.Add('invoices."DATE_TIME", TERM_NUMB, USER_NUMB, CUSTOMERID,
BATCH)');
SQL.Add('VALUES (:xINVOICE_NO, :xTOTAL, :xTAX, :xVOID_CODE,
:xTYPE_CODE,');
SQL.Add(':xDATE_TIME,'+':xTERM_NUMB, :xUSER_NUMB, :xCustomerID,
:xBATCH)');
ParamByName('xINVOICE_NO').AsString := InvoiceTotals.InvoiceNumber;
ParamByName('xTOTAL').AsFloat := InvoiceTotals.Total;
ParamByName('xTAX').AsFloat := InvoiceTotals.Tax;
ParamByName('xVOID_CODE').AsString := vcFinalized;
ParamByName('xTYPE_CODE').AsString := InvoiceTotals.TypeCode;
ParamByName('xDATE_TIME').AsDateTime := InvoiceTotals.DateTime;
ParamByName('xTERM_NUMB').AsInteger :=
FUseStation;{InvoiceTotals.StationNumb;}
ParamByName('xUSER_NUMB').AsInteger := InvoiceTotals.UserNumb;
ParamByName('xCUSTOMERID').AsString := InvoiceTotals.CustomerID;
ParamByName('xBATCH').AsString := DateToFieldStr(FUseBatch);
ExecSQL;

I realize DATE_TIME is some sort of reserved word but in this context
(ie. table name and quotes) it works on all other stations. This is
the first part of a two part SQL transaction.

What could be wrong?
Thanks - Scott Murray.

Jul 20 '05 #2
> sql.Add('INSERT INTO INVOICES (INVOICE_NO, TOTAL, TAX, VOID_CODE,
TYPE_CODE,');
SQL.Add('invoices."DATE_TIME", TERM_NUMB, USER_NUMB, CUSTOMERID,
BATCH)');
SQL.Add('VALUES (:xINVOICE_NO, :xTOTAL, :xTAX, :xVOID_CODE,
:xTYPE_CODE,');
SQL.Add(':xDATE_TIME,'+':xTERM_NUMB, :xUSER_NUMB, :xCustomerID,
:xBATCH)');

Try...

sql.Add('INSERT INTO INVOICES (INVOICE_NO, TOTAL, TAX, VOID_CODE,
TYPE_CODE,');
SQL.Add('invoices, DATE_TIME, TERM_NUMB, USER_NUMB, CUSTOMERID,
BATCH)');
SQL.Add('VALUES (:xINVOICE_NO, :xTOTAL, :xTAX, :xVOID_CODE,
:xTYPE_CODE,');
SQL.Add(':xDATE_TIME,'+':xTERM_NUMB, :xUSER_NUMB,
:xCustomerID,:xBATCH)');

I think it may be a typo after the word invoices in your second Add
statement. If you need to add in the quotes, try adding ''' instead of
" on either side of the words Date_Time

HTH

Ryan
Jul 20 '05 #3
[posted and mailed, please reply in news]

Scott Murray (sc****@cland.net) writes:
Everything works great as far as network connection, running querys,
etc. But when get to the point of saving a transaction - I am getting
the message:
"Error - EDBEngineError(General SQL error. [Microsoft]{ODBC SQL Server
Driver][SQL Server]Line 2: Incorrect syntax near 'DATE_TIME')

Here is the sql statement and partial source code:

sql.Add('INSERT INTO INVOICES (INVOICE_NO, TOTAL, TAX, VOID_CODE,
TYPE_CODE,');
SQL.Add('invoices."DATE_TIME", TERM_NUMB, USER_NUMB, CUSTOMERID,
BATCH)');


Since you are on SQL 6.5, and you are using an antique ODBC driver,
the setting QUOTED_IDENTIFIER is likely to be off, so "DATE_TIME"
here is a string literal, which of course is not legale here.

Also, I don't think that the prefix 'invoices.' is legal, and anyway
it serves no purpose.

DATE_TIME itself is not a reserved word in any sense in T-SQL.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tom Semple | last post by:
Apparently the current version of win32all does not work on win95 (please correct me if I am wrong). Python2.3.2 itself works fine. Does anyone happen to know the win32all version that last...
0
by: Aljosa Mohorovic | last post by:
which is last pywin32 that works on win95? i need it to access COM object and it needs to run on win95. version fox this mix would be nice, something like: python 2.3.4 -> which version pywin32 b...
0
by: Andreas Schulz | last post by:
Hi, I'm thinking of developing an application with C# under .NET. My problem is that the application also must be able to run under Windows 95. As known .NET cannot be installed under Win95. So...
1
by: Trygve Lorentzen | last post by:
Hi, my company has developed logistics solutions with the Borland developer product C++ Builder and Delphi. We are considering a switch to .NET with C#. The following issues are important to us:...
1
by: Piotr Nabielec | last post by:
Hi, I have very big problem with importing delphi dll into C# project... I got a Velleman K8000 card with k8d.dll that makes all communication for me. Now I'm trying to import it into C#, but I...
16
by: glenn | last post by:
I've gotten a COM server written in C# and I can call it from a VBScript just fine and it works perfectly. However, I import it into Delphi 6 or Delphi 2005 and I can not get access to any of the...
3
by: Darren | last post by:
Hello, Will applications created using VB.NET run on Win95? Regards, Darren
1
by: John Pote | last post by:
Hi all, Can someone throw some light on this problem? (is trying to run Python 2.4.2 on an old win95 box a reasonable thing to do?) I keep my old win95 box for an old eprom programmer that won't...
12
by: kid joe | last post by:
Hi I am porting an old 32 bit application that uses thunking to call a 16bit DLL under Win32s. The application uses functionality provided by a custom 16 bit DLL (there is no 32 bit version). ...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.