Results 1 to 2 of 2

Thread: HELP URGENT PLZ!!!!!!!

  1. #1

    Thread Starter
    Registered User
    Join Date
    Apr 1999
    Location
    Brazil
    Posts
    144

    Post


    What can I do?

    CASE 1 )
    txtName.Text=SomeCliente"Name

    Set dbRec = dbDB.OpenRecordSet( "SELECT * FROM CLIENTES WHERE UCASE$(cliName)=" & Chr(34) & UCase$(txtName.Text) & Chr(34) )


    CASE 2)
    txtName.Text=SomeCliente'Name

    Set dbRec = dbDB.OpenRecordSet( "SELECT * FROM CLIENTES WHERE UCASE$(cliName)='" & UCase$(txtName.Text) & "'")


    If I use this code in both situation I get an error "Object variable or With block variable not set (Error 91) ". But what can I do to pass the name that contains the " or '?

    Please I need a solution for tomorow!

    Thanks in advance.
    Jefferson

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    Change your Openrecordset call to

    Set dbRec = dbDB.OpenRecordSet("Select * From CLIENTES where cliName = '" & UCase$(txtName.Text) & "'")


    ------------------
    Marty
    What did the fish say when it hit the concrete wall?
    > > > > > "Dam!"

Posting Permissions

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



Click Here to Expand Forum to Full Width