Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2002
    Posts
    2

    Unanswered: Multiple Acces Variables Passed through Sql

    I am trying to use multiple variables in my sql statements using Visual Basic ADODC. I cant get it to work. Below is my code. Can anyone please help.

    .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\Senior Project\Timeworks02.mdb;Persist Security Info=False"
    .RecordSource = "Select sum(hourstotal) as sumHours from timecard where emp_number = & empnum and weekending = & dateweekending and bill_id = 5 and resource_id=1"

    empnum and dateweekending are my variables
    Last edited by waihiwa2; 10-10-02 at 19:04.

  2. #2
    Join Date
    Jul 2002
    Location
    Romania
    Posts
    122
    .RecordSource = "Select sum(hourstotal) as sumHours from timecard where emp_number = " & empnum & " and weekending = " & dateweekending & " and bill_id = 5 and resource_id=1"

    That should do...

  3. #3
    Join Date
    Oct 2002
    Posts
    2

    THANK YOU

    Thank You very much for the tip!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •