Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADO Filtering
Message
 
 
To
22/10/2001 10:26:00
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, United States
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Title:
Miscellaneous
Thread ID:
00571628
Message ID:
00571674
Views:
28
The filter string has the exact same rules as standard SQL, so... you need to concatenate the apostrophes into the filter statement:
objRS.Filter = "contactname = '" & txtSearch.Text & "'"
Also, you probably should run a Replace to deal with any apostrophes in the textbox:
objRS.Filter = "contactname = '" & Replace$(txtSearch.Text, "'", "''") & "'"
HTH,
John Barone
>All,
>
> Below is code I am using to set the filter on a recordset. I am getting the following error and don't know why. The error is: run time error '3001': The application is using arguments that are the wrong type, are out of the acceptable range, or are in conflict with one another.
>
> Here is the code: objRS.Filter = "contactname = " & txtSearch.Text
>
> The contactname field is from a SQL Server Database and is type Char.
>
>Any ideas?
>
>Thanks
>
>Jim
Previous
Reply
Map
View

Click here to load this message in the networking platform