- Andrew Davis
- PowerBuilder
- Saturday, 6 April 2024 03:28 PM UTC
Hi all
PB 2022 R3 Windows 10 SQL Express 15
I have always used SQL Anywhere for my database however I have a new project that requires me to connect to a SQL server database
Can you confirm what i am getting is normal - i thought you could just connect to different databases with no or very little code changes.
in SQL Anywhere if i use the SQL painter it creates this statement and it works.
SELECT "conveyor_map"."ticket_number"
INTO :ls_ticket
FROM "conveyor_map"
WHERE ( "conveyor_map"."slot_no" = :ls_slot ) AND
( "conveyor_map"."conveyor_code" = :ls_code ) ;
if I use this statement against the SQL server database I get the error message
SQLSTATE=42000
Microsoft SQL Server Native Client 11.0
Incorrect syntax near 'ticket_number'
My insert statement works - if i remove the " around the fields
e.g.
INSERT INTO conveyor_map
( ticket_number,
slot_no,
allocated,
instead of
INSERT INTO "conveyor_map"
( "ticket_number",
"slot_no",
"allocated",
SQL connection details.
// Profile conveyor_metal
SQLCA.DBMS = "SNC SQL Native Client(OLE DB)"
SQLCA.ServerName = "lmc10\sqlexpress"
SQLCA.AutoCommit = False
SQLCA.DBParm = "Provider='SQLNCLI11',Database='conveyor_metal',TrustedConnection=1,Encrypt=0,DelimitIdentifier=1,TrimSpaces=1"
Any help or ideas would be really appreciated.
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.