insert into oracle commit

T

Tomo

i have vb code

With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DRIVER={Microsoft ODBC for
Oracle};UID=tkokoska;PWD=mdc75efp;SERVER=point.world;", _
Destination:=Sheet2.Cells(1, 2))
.Sql = "Select user from dual"
.Name = "qry"
.FieldNames = False
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = True
.BackgroundQuery = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With

for connect to database and after that i have vb code for insert into oracle
table some values

Sheet2.QueryTables.Item(1).Sql = "INSERT /*+ append*/ INTO
tkokoska.probava VALUES ( " & a & ", sysdate )"
Sheet2.QueryTables.Item(1).Refresh

if i have single insert at one time, everything is all right with code, but
if i insert in loop way - walking through values and issue insert then error
ocured. it seems refresh method isn't fast enough..

i got error Run-time error '1004' this operation cannot be done because data
is refreshing in the background
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top