Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reserved Name in Pervasive

Status
Not open for further replies.

jrehm

Vendor
Oct 2, 2004
1
US
We are using something called DbNetGrid to create web pages that display info from a Pervasive SQL ACCPAC system. When we try to read the Desc field holding product descriptions within ACCPAC we get an error telling us this is a reserved name.

The makers of DbNetGrid told us we may need to declare the table when trying to read this field, but could offer no advice as to the syntax to do this.

Any help would be appreciated.
 
If you're issuing a SQL statement, you use double quotes around reserved keywords. For example:
select "desc" from table


Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
Custom VB and Btrieve development.
 
This is the actual error message that is generated.

[Pervasive][ODBC Client Interface][Pervasive][ODBC Engine Interface]Syntax Error: select OEORDD.ORDUNIQ,OEORDD.DESC<< ??? >>,OEORDD.UNITPRICE,OEORDD.QTYORDERED,OEORDD.ORDUNIT,OEORDD.QTYSHIPPED,' ' as dbnetgrid_id from OEORDD where 1=1 and (OEORDD.ORDUNIQ = 158163) order by OEORDD.ORDUNIQ

Here is a section of the code that is generating this error:

with (document.all.dbnetgrid2)
{

fromPart = "OEORDD"
orderColumn = "ORDUNIQ"
columnPicker = "true"
view = "true"
selectPart = ["ORDUNIQ","DESC","UNITPRICE","QTYORDERED","ORDUNIT","QTYSHIPPED"];
headings = ["Orduniq","Item","Price","QtyOrdered","Unit","QtyShipped"];
 
Never having worked with DbNetGrid (and not getting the email to download a trial), I don't know why it's doing this but there might be a way to delimit reserved keywords. You might try adding double quotes like:
selectPart = ["ORDUNIQ","\"DESC\"","UNITPRICE","QTYORDERED","ORDUNIT","QTYSHIPPED"];
to see if that helps.


Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
Custom VB and Btrieve development.
 
IT WORKED!!!!!!
I Can't believe I didnt think of that. Or even better yet the manufacturer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top