Results 1 to 2 of 2

Thread: access database /VB6

  1. #1
    Join Date
    Jul 2010
    Posts
    5

    access database /VB6

    I am trying to seach a table for company name and if the name if the name is not in the tbl I want be able to let the client know so they can enter the name on text box. but each time I run the programm I get the following information. Invalid statement. expected: delete, insert, procedure, select or update.

    rs.Open "StrSQL", ad, adOpenDynamic, adLockOptimistic, adCmdText

    thank you for your time

  2. #2
    Join Date
    Mar 2006
    Location
    Oklahoma City, OK
    Posts
    184
    Quote Originally Posted by alobi View Post
    I am trying to seach a table for company name and if the name if the name is not in the tbl I want be able to let the client know so they can enter the name on text box. but each time I run the programm I get the following information. Invalid statement. expected: delete, insert, procedure, select or update.

    rs.Open "StrSQL", ad, adOpenDynamic, adLockOptimistic, adCmdText

    thank you for your time

    Assuming that StrSQL is a variable that holds the SQL statement

    Try this:

    PHP Code:

    rs
    .Open StrSQLadadOpenDynamicadLockOptimisticadCmdText 
    Boyd Trimmell aka HiTech Coach
    Microsoft MVP - Access Expert
    [SIGPIC][/SIGPIC]
    Office Programming 25+ years as a Software Developer specializing in:
    Business Process Management
    Accounting/Inventory Control
    Customer Relations Management (CRM)
    Electronic Data Interchange (EDI)

Posting Permissions

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