×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Error in Expression

Error in Expression

Error in Expression

(OP)
The following code gives me :
[Pervasive][ODBC Client Interface][LNA][Pervasive][ODBC Engine Interface][Error in expression:  :BilledDate

procedure UpDateFJDataBase(AdNumber:string;BilledDate:tDateTime);
var
  EntryYear : string;
begin
  if (AdNumber[2]='C') then
    EntryYear := '2005' else
    EntryYear := '2005';

  FJMain.Query2.Close;
  FJMain.Query2.SQL.Clear;
  FJMain.Query2.SQL.Add('Update FreshJobs A');
  FJMain.Query2.SQL.Add('set A.FJInvoiceDate = :BilledDate');
  FJMain.Query2.SQL.Add('where A.AdNumber = :AdNumber');
  FJMain.Query2.SQL.Add('  and A.EntryYear = :EntryYear');

  FJMain.Query2.Params[0].asDate := BilledDate;
  FJMain.Query2.Params[1].asString := AdNumber;
  FJMain.Query2.Params[2].asString := EntryYear;

  FJQuery := FJMain.Query2.Text;
  FJMain.Query2.ExecSQL;
end;

RE: Error in Expression

You might try:
  FJMain.Query2.SQL.Add('set A.FJInvoiceDate = ?');
  FJMain.Query2.SQL.Add('where A.AdNumber = ?');
  FJMain.Query2.SQL.Add('  and A.EntryYear = ?');
Pervasive uses "?" as parameter markers.  

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
Custom VB and Btrieve development.
http://www.mirtheil.com

RE: Error in Expression

(OP)
Again you provide correct answers.  Thanks very much, it worked.  Where do you find documentation of these things?

RE: Error in Expression

I'm not really sure where it's in the Docs but I've been programming with ODBC and Pervasive (and Btrieve) for a number of years and it's just something I've picked up.  It's the same concept as using SQLBindParameter ODBC API calls.  

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
Custom VB and Btrieve development.
http://www.mirtheil.com

RE: Error in Expression

(OP)
Thanks again.  I've used the btrieve side of Pervasive since it was called Softcraft.  SQL is relatively new to me.  Thanks for your help.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close