| || |
How to insert a requete in access with db command?
I would like ton insert some records during my script in an access database.
In QARun for exemple, it's easy with the dbcommand, but with QTP, i can't find any command like this.
Thank's for your help
Re: How to insert a requete in access with db command?
I think here you will have to use ADODB.
Try this peice of code in QTP.
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adUseClient = 3
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordset = CreateObject("ADODB.Recordset")
objRecordset.CursorLocation = adUseClient
objRecordset.CursorType = adopenstatic
objRecordset.LockType = adlockoptimistic
objRecordset.Source="Insert SQL Query"
I hope it does your work [img]images/icons/smile.gif[/img]