Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Recordset FIND problems
Message
Information générale
Forum:
Visual Basic
Catégorie:
COM, DCOM et OLE automation
Divers
Thread ID:
00566810
Message ID:
00566840
Vues:
13
>>Hi, I am going to be searching for a record in the db.I am using the recordset.find method to search through the data.
>>Heres the code..
>>
>>Dim cnClientdata As ADODB.Connection
>>Dim rsClientdata As ADODB.Recordset
>>Dim sFindCriteria As String
>>
>>Set cnClientdata = New ADODB.Connection
>>Set rsClientdata = New ADODB.Recordset
>>
>>sFindCriteria = "clientphone like '" & _
>> Phonenum & "*'"
>>
>>
>>With cnClientdata
>> .Provider = "SQLOLEDB"
>> .ConnectionString = "User ID=user;Password=user;" & _
>> "Data Source=user;" & _
>> "Initial Catalog=user"
>> .Open
>>
>>End With
>>
>>*When this line gets executed, I get an error: COMMAND TEXT NOT SET *
>>* What does this mean ? *
>>
>> rsClientdata.Open , cnClientdata
>> rsClientdata.MoveFirst
>> rsClientdata.Find SearchCriteria, , adSearchForward
>>
>> Thanks
>>Niv
>
>
>Use % instead of *

And also, you have to give a query string on the line
>> rsClientdata.Open , cnClientdata
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform