473,624 Members | 2,447 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ado updatebatch problem

I'm currently experiencing a problem using ADO 2.7 with DB2 7
(DB2 UDB FOR OS/390 V7). I use ODBC like datasource.
After populating a disconnected recordset, reconnecting it, and doing
a UpdateBatch the application (VB6) disappears - it just stops and
vanishes.
can anyone suggest a way for solve my problem?

Thanks.

'************** *************** *************** *************** ********
Here it the source code :

Private Sub caricaTRADEviaB atch()

Dim sQuery As String, bDelete As Boolean, bSalva As Boolean
Dim sDelete As String, sErr As String
Dim sName As String, sPath As String
Dim Fn, iConta As Integer, sTEXTLINE As String
Dim CONTA_TOT As Integer

Dim objRs As Recordset, cn As New ADODB.Connectio n

sQuery = "SELECT * FROM CEC.T2254_TRADE _GENER" & _
" WHERE C2254_AZIENDA_C = " & frmAvvio.codAzi enda &
_
" AND C2254_ANNO = " & frmAvvio.anno & _
" AND C2254_MESE = " & iMese
Set objRs = New ADODB.Recordset
cn.ConnectionSt ring = glo.sConnect
cn.Open
objRs.CursorLoc ation = adUseClient
objRs.Open sQuery, cn, adOpenStatic, adLockBatchOpti mistic,
adCmdText
Debug.Print objRs.EOF
Set objRs.ActiveCon nection = Nothing
cn.Close

Fn = FreeFile
sName = UCase(FilList.L ist(FilList.Lis tindex))
sPath = UCase(FilList.P ath) & "\"
CONTA_TOT = FileLen(sPath & "\" & sName) / 260

prbCarica.Heigh t = Me.cmdCarica.He ight + 50
prbCarica.ZOrde r
prbCarica.Min = 0
prbCarica.value = prbCarica.Min
prbCarica.Max = CONTA_TOT
prbCarica.Visib le = True

Open sPath & "\" & sName For Input As #Fn

Dim vCampi As Variant, vValore As Variant
Dim vElem, i As Integer

Do Until EOF(Fn)

iConta = iConta + 1
Line Input #Fn, sTEXTLINE ' Read line into variable.
vElem = Split(sTEXTLINE , ";") 'da 0 a 44 (45 colonne)
If iConta = 1 Then vCampi = vElem
prbCarica.value = iConta

If iConta > 1 Then
objRs.AddNew
For i = 0 To 44
vValore = vElem(i)
If Len(vValore) = 0 Then vValore = " "
vValore = Left(vValore, 32)
If IsNumeric(vValo re) Then
vValore = Replace(vValore , ",", ".")
End If
Select Case Trim(vCampi(i))
Case "IMPOSTA", "IVANOREC", "IMPONIVA"
vValore = " "
Case "CATMER", "IMP"
If Not IsNumeric(vValo re) Then
vValore = 0
End If
End Select

objRs(0) = frmAvvio.codAzi enda
objRs(1) = frmAvvio.anno
objRs(2) = iMese
objRs(3) = iConta - 1
objRs(4) = Date
objRs(5) = Time
objRs(6 + i) = vValore

Next i

End If
Debug.Print sTEXTLINE
DoEvents
Loop

cn.Open
Set objRs.ActiveCon nection = cn
objRs.UpdateBat ch

prbCarica.Visib le = False
Screen.MousePoi nter = vbDefault

End Sub
Nov 12 '05 #1
1 3411
Use the MS ADO over ODBC driver together withthe the IBM ODBC driver.

"Vascelli Germano" <gv*******@libe ro.it> wrote in message
news:39******** *************** ***@posting.goo gle.com...
I'm currently experiencing a problem using ADO 2.7 with DB2 7
(DB2 UDB FOR OS/390 V7). I use ODBC like datasource.
After populating a disconnected recordset, reconnecting it, and doing
a UpdateBatch the application (VB6) disappears - it just stops and
vanishes.
can anyone suggest a way for solve my problem?

Thanks.

'************** *************** *************** *************** ********
Here it the source code :

Private Sub caricaTRADEviaB atch()

Dim sQuery As String, bDelete As Boolean, bSalva As Boolean
Dim sDelete As String, sErr As String
Dim sName As String, sPath As String
Dim Fn, iConta As Integer, sTEXTLINE As String
Dim CONTA_TOT As Integer

Dim objRs As Recordset, cn As New ADODB.Connectio n

sQuery = "SELECT * FROM CEC.T2254_TRADE _GENER" & _
" WHERE C2254_AZIENDA_C = " & frmAvvio.codAzi enda &
_
" AND C2254_ANNO = " & frmAvvio.anno & _
" AND C2254_MESE = " & iMese
Set objRs = New ADODB.Recordset
cn.ConnectionSt ring = glo.sConnect
cn.Open
objRs.CursorLoc ation = adUseClient
objRs.Open sQuery, cn, adOpenStatic, adLockBatchOpti mistic,
adCmdText
Debug.Print objRs.EOF
Set objRs.ActiveCon nection = Nothing
cn.Close

Fn = FreeFile
sName = UCase(FilList.L ist(FilList.Lis tindex))
sPath = UCase(FilList.P ath) & "\"
CONTA_TOT = FileLen(sPath & "\" & sName) / 260

prbCarica.Heigh t = Me.cmdCarica.He ight + 50
prbCarica.ZOrde r
prbCarica.Min = 0
prbCarica.value = prbCarica.Min
prbCarica.Max = CONTA_TOT
prbCarica.Visib le = True

Open sPath & "\" & sName For Input As #Fn

Dim vCampi As Variant, vValore As Variant
Dim vElem, i As Integer

Do Until EOF(Fn)

iConta = iConta + 1
Line Input #Fn, sTEXTLINE ' Read line into variable.
vElem = Split(sTEXTLINE , ";") 'da 0 a 44 (45 colonne)
If iConta = 1 Then vCampi = vElem
prbCarica.value = iConta

If iConta > 1 Then
objRs.AddNew
For i = 0 To 44
vValore = vElem(i)
If Len(vValore) = 0 Then vValore = " "
vValore = Left(vValore, 32)
If IsNumeric(vValo re) Then
vValore = Replace(vValore , ",", ".")
End If
Select Case Trim(vCampi(i))
Case "IMPOSTA", "IVANOREC", "IMPONIVA"
vValore = " "
Case "CATMER", "IMP"
If Not IsNumeric(vValo re) Then
vValore = 0
End If
End Select

objRs(0) = frmAvvio.codAzi enda
objRs(1) = frmAvvio.anno
objRs(2) = iMese
objRs(3) = iConta - 1
objRs(4) = Date
objRs(5) = Time
objRs(6 + i) = vValore

Next i

End If
Debug.Print sTEXTLINE
DoEvents
Loop

cn.Open
Set objRs.ActiveCon nection = cn
objRs.UpdateBat ch

prbCarica.Visib le = False
Screen.MousePoi nter = vbDefault

End Sub

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
469
by: Ellen K. | last post by:
Awhile back there was some discussion about ways of sending multiple rows of data to SQL Server. The ADO .UpdateBatch method was one of the possibilities mentioned, and Erland said he thought that probably once the data get to SQL Server they are probably actually inserted one row at a time. I just want to say that based on an experience I had a couple of days ago I am now sure that is the case. I was using ..UpdateBatch for something...
0
357
by: Giovanni pepe | last post by:
I have then necessity of utilize old UpdateBatch of vb6 in VB DotNet.. I have View as in net it must be used Command Builder, Where I can find some example... Thank you
117
7172
by: Peter Olcott | last post by:
www.halting-problem.com
28
5199
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass(); .... and then call the virtual method, why is it that the base class's method is called instead of the overridden method? How do I fix this if I don't know at runtime what the child class is? I'm using Activator.CreateInstance() to load the...
6
3799
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length is more that 1249 bytes, then the progress bar of the browser will move too slow and then displaying that the page not found!!!! If the message is less than or equal to 1249 then no problem.
0
1044
by: Giovanni pepe | last post by:
This is my error : <<impossible to approach the information on the line eliminated through the line>> This is my code for updateBatch : Private mSqlConn as sqlConnection Public Function UpdateBatch(ByVal DTable As DataTable) Dim mSqlDa As SqlDataAdapter Dim MustCloseConnection As Boolean
16
4900
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by Microsoft must be installed on their servers. Now german Umlaute (ä, ü, ö) and quotes are returned incorrectly in SOAP fault responses. This can be easily verified: Implement the following in a web service method (just raises a SOAPException with a...
2
4544
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was set to...it is set to false. Can someone show me what I am doing wrong and tell me the correct way? Thank you. In the page load event, I am doing the following:
1
3586
patjones
by: patjones | last post by:
Hi: I am attempting to pull a backend table into a local recordset, make some changes to it, and commit the changes back to the table. I'm using an ADO recordset in Access 2007. The backend resides on a network drive while the front end is on my C: drive. My code is as follows: Dim rstBalances As New ADODB.Recordset Dim strSQL As String strSQL = "SELECT fldDateEffective, fldCurrentAL, fldCurrentSick, fldCurrentCT,...
0
8168
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8672
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8614
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6107
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4075
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4167
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1474
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.