ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   insert into oracle commit (https://www.excelbanter.com/excel-programming/411875-insert-into-oracle-commit.html)

Tomo

insert into oracle commit
 
i have vb code

With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DRIVER={Microsoft ODBC for
Oracle};UID=tkokoska;PWD=mdc75efp;SERVER=point.wor ld;", _
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





All times are GMT +1. The time now is 08:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com