473,385 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Run-time error "7": Error executing statement! Error:[Microsoft][ODBC dBase Driver]

2
Hi, I'm new in this forum, and i hope someone can help.

I'm creating an automatic application that transfer a database from Access -> DBF -> Oracle.

When My App try to execute Insert SQL statement from DBF to Oracle database i found an error like this

{Run-time error "7": Error executing statement! Error:[Microsoft][ODBC dBase Driver] System resource exceeded.}

and then my program crash! i have to close my app, and start again.
could some one help me to solve my problem, below this is Example of SQL statement wrote for transfering databse from dbf to oracle:


Expand|Select|Wrap|Line Numbers
  1. Private Sub Simpan_AKU()
  2. 2274   On Error GoTo vbwErrHandler
  3. 2275   On Error GoTo B_Aku
  4. 2276   database_ora.BeginTrans
  5. 2277   If Adodc_DBF.Recordset.RecordCount > 0 Then
  6. 2278       Adodc_DBF.Recordset.MoveLast
  7. 2279       pbarStatus.Min = 0
  8. 2280       pbarStatus.Max = Adodc_DBF.Recordset.RecordCount
  9. 2281       Adodc_DBF.Recordset.MoveFirst
  10. 2282       ssql = "delete amu_cust_temp_t "
  11. 2283       ssql = ssql & " where kd_Store = '" & Mid(xnama_file, 1, 4) & "'"
  12. 2284       ssql = ssql & " and tgl_input = to_date('" & dtPilih.Value & "','dd-mm-rrrr')"
  13. 2285       database_ora.Execute ssql
  14. 2286       xOno = 0
  15. 2287   Else
  16. 2288       xOno = 1
  17. 2289   End If
  18. 2290   coun = 0
  19. 2291   Do While Adodc_DBF.Recordset.EOF = False
  20. 2292       coun = coun + 1
  21. 2293       pbarStatus = coun
  22. 2294       ssql = " insert into amu_cust_temp_t (KD_STORE, NO_KARTU, NM_PANG, "
  23. 2295       ssql = ssql & " ALAMAT, TELP, KD_KASIR, TGL_INPUT, TGL_PROSES, FLAG) "
  24. 2296       ssql = ssql & " values ("
  25. 2297       ssql = ssql & "'" & Adodc_DBF.Recordset![Kd_Store] & "',"
  26. 2298       ssql = ssql & "'" & Adodc_DBF.Recordset![NO_KARTU] & "',"
  27. 2299       ssql = ssql & "'" & Adodc_DBF.Recordset![NMPANG] & "',"
  28. 2300       ssql = ssql & "'" & Left(Trim(Adodc_DBF.Recordset![alamat]), 40) & "',"
  29. 2301       ssql = ssql & "'" & Adodc_DBF.Recordset![TELP] & "',"
  30. 2302       ssql = ssql & Val(Adodc_DBF.Recordset![kd_kasir] & "") & ","
  31. 2303       ssql = ssql & "'" & Format(Adodc_DBF.Recordset![TGL_INPUT], "dd-mmm-yyyy") & "',"
  32. 2304       ssql = ssql & "'" & Format(Date, "dd-mmm-yyyy") & "',0)"
  33. 2305       database_ora.Execute ssql
  34. 2306       xOno = 1
  35. 2307       Adodc_DBF.Recordset.MoveNext
  36. 2308   Loop
  37. 2309   Adodc_DBF.Recordset.Close
  38. 2310   If xOno > 0 Then
  39. 2311     On Error GoTo B_Log
  40. 2312     ssql = "insert into amu_log_data_toko_t ("
  41. 2313     ssql = ssql & " KD_STORE,TANGGAL,TGL_RUBAH,AKU "
  42. 2314     ssql = ssql & " ) VALUES ( "
  43. 2315     ssql = ssql & "'" & Mid(xnama_file, 1, 4) & "',"
  44. 2316     ssql = ssql & "'" & Format(dtPilih, "dd-mmm-yyyy") & "',"
  45. 2317     ssql = ssql & "'" & Format(Date, "dd-mmm-yyyy") & "',"
  46. 2318     ssql = ssql & "1) "
  47. 2319     database_ora.Execute ssql
  48. 2320   End If
  49. 2321   database_ora.CommitTrans
  50. 2322   Exit Sub
  51. 2323 B_Log:
  52. 2324   If Err.Number = -2147217873 Then
  53. 2325       ssql = "update amu_log_data_toko_t set "
  54. 2326       ssql = ssql & " TGL_RUBAH='" & Format(Date, "dd-mmm-yyyy") & "', "
  55. 2327       ssql = ssql & " AKU = nvl(AKU,0)+1"
  56. 2328       ssql = ssql & " where "
  57. 2329       ssql = ssql & "kd_store = '" & Mid(xnama_file, 1, 4) & "' and "
  58. 2330       ssql = ssql & "tanggal = '" & Format(dtPilih, "dd-mmm-yyyy") & "'"
  59. 2331       database_ora.Execute ssql
  60. 2332       Resume Next
  61. 2333   Else
  62. 2334       Print #1, Time & " " & Err.Description & " " & xnama_file
  63. 2335       database_ora.RollbackTrans
  64. 2336       database_ora.CommitTrans
  65. 2337       Exit Sub
  66. 2338   End If
  67. 2339   Exit Sub
  68. 2340 B_Aku:
  69. 2341   If Err.Number = -2147217873 Then
  70. 2342       Resume Next
  71. 2343   Else
  72. 2344       Print #1, Time & " " & Err.Description & " " & xnama_file
  73. 2345       database_ora.RollbackTrans
  74. 2346       database_ora.CommitTrans
  75. 2347       Exit Sub
  76. 2348   End If
  77. ' <VB WATCH>
  78. 2349       Exit Sub
  79.     ' ----- Error Handler ------
  80. vbwErrHandler:
  81.     Const VBWPROCEDURE = "Simpan_Aku"
  82.  
  83.     Select Case MsgBox("Error " & Err.Number & vbCrLf & _
  84.                       Err.Description & vbCrLf & _
  85.                      "Location: " & VBWPROJECT & "." & VBWMODULE & "." & VBWPROCEDURE & vbCrLf & _
  86.                      "Line " & Erl, _
  87.                      vbAbortRetryIgnore)
  88.       Case vbAbort
  89.           End
  90.       Case vbRetry
  91.           Resume
  92.       Case vbIgnore
  93.           Resume Next
  94.   End Select
  95.  
  96. End Sub
is there Something Wrong in My Code???
Aug 1 '07 #1
3 3859
fplesco
82
Hi, I'm new in this forum, and i hope someone can help.

I'm creating an automatic application that transfer a database from Access -> DBF -> Oracle.

When My App try to execute Insert SQL statement from DBF to Oracle database i found an error like this

{Run-time error "7": Error executing statement! Error:[Microsoft][ODBC dBase Driver] System resource exceeded.}

and then my program crash! i have to close my app, and start again.
could some one help me to solve my problem, below this is Example of SQL statement wrote for transfering databse from dbf to oracle:


Expand|Select|Wrap|Line Numbers
  1. Private Sub Simpan_AKU()
  2. 2274   On Error GoTo vbwErrHandler
  3. 2275   On Error GoTo B_Aku
  4. 2276   database_ora.BeginTrans
  5. 2277   If Adodc_DBF.Recordset.RecordCount > 0 Then
  6. 2278       Adodc_DBF.Recordset.MoveLast
  7. 2279       pbarStatus.Min = 0
  8. 2280       pbarStatus.Max = Adodc_DBF.Recordset.RecordCount
  9. 2281       Adodc_DBF.Recordset.MoveFirst
  10. 2282       ssql = "delete amu_cust_temp_t "
  11. 2283       ssql = ssql & " where kd_Store = '" & Mid(xnama_file, 1, 4) & "'"
  12. 2284       ssql = ssql & " and tgl_input = to_date('" & dtPilih.Value & "','dd-mm-rrrr')"
  13. 2285       database_ora.Execute ssql
  14. 2286       xOno = 0
  15. 2287   Else
  16. 2288       xOno = 1
  17. 2289   End If
  18. 2290   coun = 0
  19. 2291   Do While Adodc_DBF.Recordset.EOF = False
  20. 2292       coun = coun + 1
  21. 2293       pbarStatus = coun
  22. 2294       ssql = " insert into amu_cust_temp_t (KD_STORE, NO_KARTU, NM_PANG, "
  23. 2295       ssql = ssql & " ALAMAT, TELP, KD_KASIR, TGL_INPUT, TGL_PROSES, FLAG) "
  24. 2296       ssql = ssql & " values ("
  25. 2297       ssql = ssql & "'" & Adodc_DBF.Recordset![Kd_Store] & "',"
  26. 2298       ssql = ssql & "'" & Adodc_DBF.Recordset![NO_KARTU] & "',"
  27. 2299       ssql = ssql & "'" & Adodc_DBF.Recordset![NMPANG] & "',"
  28. 2300       ssql = ssql & "'" & Left(Trim(Adodc_DBF.Recordset![alamat]), 40) & "',"
  29. 2301       ssql = ssql & "'" & Adodc_DBF.Recordset![TELP] & "',"
  30. 2302       ssql = ssql & Val(Adodc_DBF.Recordset![kd_kasir] & "") & ","
  31. 2303       ssql = ssql & "'" & Format(Adodc_DBF.Recordset![TGL_INPUT], "dd-mmm-yyyy") & "',"
  32. 2304       ssql = ssql & "'" & Format(Date, "dd-mmm-yyyy") & "',0)"
  33. 2305       database_ora.Execute ssql
  34. 2306       xOno = 1
  35. 2307       Adodc_DBF.Recordset.MoveNext
  36. 2308   Loop
  37. 2309   Adodc_DBF.Recordset.Close
  38. 2310   If xOno > 0 Then
  39. 2311     On Error GoTo B_Log
  40. 2312     ssql = "insert into amu_log_data_toko_t ("
  41. 2313     ssql = ssql & " KD_STORE,TANGGAL,TGL_RUBAH,AKU "
  42. 2314     ssql = ssql & " ) VALUES ( "
  43. 2315     ssql = ssql & "'" & Mid(xnama_file, 1, 4) & "',"
  44. 2316     ssql = ssql & "'" & Format(dtPilih, "dd-mmm-yyyy") & "',"
  45. 2317     ssql = ssql & "'" & Format(Date, "dd-mmm-yyyy") & "',"
  46. 2318     ssql = ssql & "1) "
  47. 2319     database_ora.Execute ssql
  48. 2320   End If
  49. 2321   database_ora.CommitTrans
  50. 2322   Exit Sub
  51. 2323 B_Log:
  52. 2324   If Err.Number = -2147217873 Then
  53. 2325       ssql = "update amu_log_data_toko_t set "
  54. 2326       ssql = ssql & " TGL_RUBAH='" & Format(Date, "dd-mmm-yyyy") & "', "
  55. 2327       ssql = ssql & " AKU = nvl(AKU,0)+1"
  56. 2328       ssql = ssql & " where "
  57. 2329       ssql = ssql & "kd_store = '" & Mid(xnama_file, 1, 4) & "' and "
  58. 2330       ssql = ssql & "tanggal = '" & Format(dtPilih, "dd-mmm-yyyy") & "'"
  59. 2331       database_ora.Execute ssql
  60. 2332       Resume Next
  61. 2333   Else
  62. 2334       Print #1, Time & " " & Err.Description & " " & xnama_file
  63. 2335       database_ora.RollbackTrans
  64. 2336       database_ora.CommitTrans
  65. 2337       Exit Sub
  66. 2338   End If
  67. 2339   Exit Sub
  68. 2340 B_Aku:
  69. 2341   If Err.Number = -2147217873 Then
  70. 2342       Resume Next
  71. 2343   Else
  72. 2344       Print #1, Time & " " & Err.Description & " " & xnama_file
  73. 2345       database_ora.RollbackTrans
  74. 2346       database_ora.CommitTrans
  75. 2347       Exit Sub
  76. 2348   End If
  77. ' <VB WATCH>
  78. 2349       Exit Sub
  79.     ' ----- Error Handler ------
  80. vbwErrHandler:
  81.     Const VBWPROCEDURE = "Simpan_Aku"
  82.  
  83.     Select Case MsgBox("Error " & Err.Number & vbCrLf & _
  84.                       Err.Description & vbCrLf & _
  85.                      "Location: " & VBWPROJECT & "." & VBWMODULE & "." & VBWPROCEDURE & vbCrLf & _
  86.                      "Line " & Erl, _
  87.                      vbAbortRetryIgnore)
  88.       Case vbAbort
  89.           End
  90.       Case vbRetry
  91.           Resume
  92.       Case vbIgnore
  93.           Resume Next
  94.   End Select
  95.  
  96. End Sub
is there Something Wrong in My Code???

Hi there DontB3 -

Your code is very complicated and it would take quite sometime to trace it. In my perspective, you are the best one to find it out why. Well, its because you have the test environment setup already in your workstation.

For now, maybe I can give you a clue on how to deal with it (debug). Comment all error handlers and labels you have .

1. On Error GoTo vbwErrHandler
2. On Error GoTo B_Aku

And see where that error points at. That way, you can focus on the code that is really causing the error and the program crash. If you happen to locate it, and still dont know why and how to deal with it, you can get back to this forum, okay?

Goodluck...
Aug 1 '07 #2
DontB3
2
Hi there DontB3 -

Your code is very complicated and it would take quite sometime to trace it. In my perspective, you are the best one to find it out why. Well, its because you have the test environment setup already in your workstation.

For now, maybe I can give you a clue on how to deal with it (debug). Comment all error handlers and labels you have .

1. On Error GoTo vbwErrHandler
2. On Error GoTo B_Aku

And see where that error points at. That way, you can focus on the code that is really causing the error and the program crash. If you happen to locate it, and still dont know why and how to deal with it, you can get back to this forum, okay?

Goodluck...
Thank's fplesco for the clue,.. but still i haven't found away to solve this problem. Error handlers on my code it for handling error an write it to a file (vbwErrHandler) and to Update a record on Oracle if theres already same record on the table.

trully This error not often happent, but cause i work on online database that using MsAccess, DBF, and Oracle. My Company said this is a problem, cause i hape to transfer database moreless 200 DBF's file/City(Branch) into Oracle in onenight. and if one of file is crash/erro there's alot a file in Qued.

Maybe Could You tell me what cause that error appear! is there something wrong with my Database Connection or my Query Script?

(if sorry if english not as good as you, i'm still learning. And i hope this is not become a redthinline to join in this forum)
Aug 1 '07 #3
fplesco
82
Thank's fplesco for the clue,.. but still i haven't found away to solve this problem. Error handlers on my code it for handling error an write it to a file (vbwErrHandler) and to Update a record on Oracle if theres already same record on the table.

trully This error not often happent, but cause i work on online database that using MsAccess, DBF, and Oracle. My Company said this is a problem, cause i hape to transfer database moreless 200 DBF's file/City(Branch) into Oracle in onenight. and if one of file is crash/erro there's alot a file in Qued.

Maybe Could You tell me what cause that error appear! is there something wrong with my Database Connection or my Query Script?

(if sorry if english not as good as you, i'm still learning. And i hope this is not become a redthinline to join in this forum)

Hi there -

I have spotted some contrasting statements in your code.

database_ora.RollbackTrans
database_ora.CommitTrans

I am not sure about this because I haven't been using Oracle. I am used to MS SQL Server backend. But I think these are contrasting statements.

Since, it is in the Error Handler statement block, I think what you need is only the "database_ora.RollbackTrans".
Aug 2 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Tom D. | last post by:
I just got a new computer. I transfered my web site files over and setup my access database system ODBC driver. I've compared settings on both computers. But when I run my web site code on new...
2
by: Martijn Rutte | last post by:
Hi, On one side, I have a Sybase 12.5 32 bits Server running on AIX 5.1 (maintenance level 3). On the other, I've got W2000 5.00.2195 (SP2) with SQL Server Standard Edition, Product Version...
1
by: Tim | last post by:
Hi all, Here is a brief description of a problem I encountered, and how I found a work around after 3 long days. I have a VB6 app that uses ADO and ODBC to get communicate with SQL server 2000...
4
by: Marcin Zmyslowski | last post by:
Hello everyone! I have the following problem. I`ve opened a Query Analyser and write the statement: -isql -S 'PL6XXXX' -i 'd:\SQL_Server_2000\Raport_WWW.sql' I got the following erorr...
6
by: Ian Davies | last post by:
Hello I have the following code to connect to mySQL database from VB6 ******************************************** Private Sub Form_Load() Dim conn As ADODB.Connection Set conn = New...
476
by: Xah Lee | last post by:
Microsoft Hatred, FAQ Xah Lee, 20020518 Question: U.S. Judges are not morons, and quite a few others are not morons. They find MS guilty, so it must be true. Answer: so did the German...
9
by: Paul | last post by:
Hi all Arggghhh........... The problem.....I want the user to be able to create an excel document and name particular cells in the document where they want the data to be placed and then save...
7
by: Zlatko Matić | last post by:
Let's assume that we have a database on some SQL server (let it be MS SQL Server) and that we want to execute some parameterized query as a pass.through query. How can we pass parameters to the...
2
by: johnlarson | last post by:
I am trying to populate a datagrid from a select statement that contains variables. I can query the dbf file and get the whole file but when I try a select statement with variables from text box and...
17
by: bplantes | last post by:
I have loved the quick responses that I have received using thescripts.com for a couple of my prior questions. I thought I would ask the question here as I haven't been able to get a good result...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.