|
-
December 20th, 1999, 05:53 AM
#1
Select 0 records/Open a empty Recordset object
hi,
I am creating a VB Form which in used only to insert a new Customer record using ADO / Recordset in the database.
I want to open the recordset object with zero records.
so i am using a code
Dim cn as Connection
Dim rs as Recordset
Dim lsSQL as string
'....
'....
lsSQL = "select * from Customer_Master where 1=2 "
rs.open = lsSQL,cn,adOpenKeyset, adLockOptimistic
'open the recordset with 0 records , since 1=2 will fail for all records in database.
'...
'...
rs.Addnew
'... set the recordset fields
rs.Update
rs.Close
Is there some better way than this, other than using the SQL Insert statement. !!!
Thanks
Sameer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|