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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL underscore Fields in Pervasive SQL 2000i 1

Status
Not open for further replies.

zipur

Programmer
Jul 5, 2002
13
CA
I need to access from a Pervasive 2000i server via ODBC. The ODBC is working fine but the data names in the table are causing problems. The datanames were named as _name, _address, _faxnum, ....

I realize this is not the best naming convention, and it was a different company that did this.

Anyway, If I do this it works:

Select * From custinfo

But if I do any of these it fails:

Select * From custinfo WHERE _name LIKE'%test%'
Select [_name] From custinfo
Select _name From custinfo

If I do this on the server from within the Pervasive SQL Manager, it works... BUT through ODBC it fails.

Select [_name] From custinfo

Any Ideas?
 
You need to use a statement like:
select "_name" from custinfo

Any time you have spaces or special characters (like underscore, operators, etc), you need to use double quotes to delimit the field (or table) name.


info@mirtheil.com
Custom VB and Btrieve development.
Certified Pervasive Developer
Certified Pervasive Technician
 
That got it working.

Thanks, I think I tried everything other than that :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top