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!

Pervasive SQL v8.5

Status
Not open for further replies.

JimReiley

MIS
Dec 10, 2004
58
US
I would very much like to have access to a very small sample program that simply connects to a couple tables use the Pervasive sql controls for Delphi. If anybody has a small sample program, I would appreciate it.

JR
 
Check out specifically the sample called "PDAC Samples". It's 618KB (According to the site) and does both PvTable and PvQuery to access databases. If you need something else post here and I'll see what I can come up with. No guarantees though (I prefer VB or C# but have done some Delphi work). I think the samples are Delphi 7. I've been told thata Delphi 2005 version of PDAC is forthcoming.


Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
Custom VB and Btrieve development.
 
Thanks, that helped me get over a hurdle or two. Now here's a problem. The code below cause's the exception after it.

form1.PvSQLSession1.ServerName := 'Adentry';
form1.PvQuery1.DatabaseName := 'MillerOE';
form1.PvQuery1.SQL.Add ('select * from ' + #34 + 'Contract_record' + #34);
form1.PvQuery1.SQL.Add (' where ClientNumber = ' + form1.tbCLient.FieldByName('ClientNumber').asString);
form1.PvQuery1.Active := true;

Incompatible types in predicate.

What does that mean? If I leave off the 2nd 'sql.add, it works fine.
 
What data type is "ClientNumber"? If it's a string, you need to delimit it with single quotes. For example:
Code:
form1.PvQuery1.SQL.Add (' where ClientNumber = ''' +      form1.tbCLient.FieldByName('ClientNumber').asString) + '''';
(The code above may not be exact as I'm doing it from memory).
If it's not a string, try removing the ".asString" from the line.


Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
Custom VB and Btrieve development.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top