SQL result freezes datacontrol

SQL result freezes datacontrol

Post by Paul Wats » Wed, 22 Sep 1999 04:00:00



Hi, I am using the code below and two things are not ok.
Firstly the form freezes after finding the correct name and
the Like argument doesn't find anything other than an exact
entry.

Any help would be much appreciated to this newbie (myself)
please email me as it is very easy to miss postings.

TIA,

Paul

Dim sqltxt As String
Dim db As Database
Set db = OpenDatabase("D:\vb5\bt1\vispro41.mdb")
sqltxt = "SELECT * FROM [client details] WHERE lastname LIKE '" &
txtfind & "';"
datPrimaryRS.RecordSource = sqltxt
datPrimaryRS.Refreshh

 
 
 

SQL result freezes datacontrol

Post by Arjen Haaym » Thu, 23 Sep 1999 04:00:00




Hi Paul,

I don't know about the freezing, but I can help you with the 'like'
problem.

You should use wildcards with the like-clause.

Quote:>Dim sqltxt As String
>Dim db As Database
>Set db = OpenDatabase("D:\vb5\bt1\vispro41.mdb")
>sqltxt = "SELECT * FROM [client details] WHERE lastname LIKE '" &
>txtfind & "';"

This should be:
sqltxt = "SELECT * FROM [client details] WHERE lastname LIKE '*" &
                                                              ^
txtfind & "*';"
           ^

Or, if you'd be using SQL-server '%' instead of '*'

Arjen Haayman

 
 
 

1. Recordset name for datacontrol result

What is the recordset name when you build a dynaset by using an SQL
statement in the RecordSource property of a data control.

I want to use the SQL query to open a form with a selected record for
editing. I want to be able to issue commands like:

  recordsetname.edit
  .......
  recordsetname.update

How do you accomplish this when the recordset was "built" by a SQL
statement in the RecordSource property of a data control?

TIA

Wayne Wengert

2. Empty a table..

3. Pointing the DataControl from a search result

4. SQL - sun interface

5. SQL - result result order

6. Custom SortOrder - How to create the definition file?

7. DataControl On Line Update with SQL Passthrough

8. Apply structural changes from server to server

9. Which is best: SQL-DMO or ADO DataControl?

10. VB 5.0, ODBC, DataControl.Recordset.Bookmark problem, SQL Anywhere

11. How to execute an SQL statement on a datacontrol

12. dblist with SQL in a datacontrol

13. Delete SQL Data in DBase IV in DataControl