Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Instert and Update Data into a mdb (database access) file.

Status
Not open for further replies.

DanteA

Technical User
Jun 14, 2012
5
MX
Hi everyone, i have this vbs code:

Code:
Const adOpenStatic = 3
Const adLockOptimistic = 3

Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")

objConnection.Open _
    "Provider = Microsoft.Jet.OLEDB.4.0; " & _
        "Data Source = C:\Path\base.mdb"

objRecordSet.Open "INSERT INTO TemporalAd (Maquina, Codigo, IdArticulo, Detalle, Cantidad, PUnitario, IdUnidad)" &  _
    "VALUES ('1', '11234','2', 'Impresion Color', '1','25','2')", _
        objConnection, adOpenStatic, adLockOptimistic

objRecordSet.Open _
  "Update Temporal " & _
  "Set Adicionales = (1)", _
    objConnection, adOpenStatic, _
    adLockOptimistic

And it works very well, but the changes into the table not are made "on the fly" i mean, is necessary a kind of "refresh" in the table in order the changes be displayed ( for example if i close and open the database file the changes are well updated). I wonder if exist a trick or some way to refresh automatically the data inserted

Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top