|
-
Oct 6th, 2007, 06:56 AM
#1
Thread Starter
Addicted Member
[RESOLVED] VB6 complile error:Too many arguments
Hi,
I have a vb6 application I which selects a csv file and imports it in sql server 2000 database tables. I am adding further fields (just one at mo while i am trying to undertand it) in the csv file. I have a function which I believe needs to add a argument of the new field i am adding but i am getting the error: too many arguments.
Can you please help or explain why is this?
Part of the code is shown below. I can provide more if you are willing to have a look.
thanks
df
Code:
Private Function InsertHoldingData(dteBatchDate As Date, _
BatchName As String, URN As String, _
Title As String, Initial As String, Surname As String, _
Organisation As String, POBox As String, _
Address1 As String, Address2 As String, Address3 As String, _
Locality As String, Town As String, County As String, Postcode As String, _
DPS As String, Country As String, CountryCode As String, _
Telephone As String, Email As String, dteBirthday As Variant, _
AgeUnder25 As Integer, Age2635 As Integer, Age3645 As Integer, _
Age4655 As Integer, Age5565 As Integer, AgeOver65 As Integer, _
CdiorUser As Integer, StoreCardHolder As Integer, _
DoNotMail As Integer, DoNotTel As Integer, DoNotEmail As Integer, _
DoNotPass As Integer, dteInitialDate As Date, _
SkinCareFocusDry As Integer, SkinCareFocusDehyd As Integer, _
SkinCareFocusFirstSignAge As Integer, _
SkinCareFocusVisibleAge As Integer, SkinCareFocusFirm As Integer, _
SkinCareFocusRadiance As Integer, SkinCareFocusOil As Integer, _
ProdPurchBasics As Integer, ProdPurchAA As Integer, _
ProdPurchIOD As Integer, ProdPurchPrestige As Integer, _
ProdPurchFoundation As Integer, ProdPurchMakeUp As Integer, _
ProdPurchFF As Integer, ProdPurchMF As Integer, _
ProdPurchCapture As Integer, ProdPurchNoAge As Integer, ProdPurchMove As Integer, _
ProdPurchBikini As Integer, ProdPurchBronze As Integer, _
ProdPurch As Currency, Store As String, Suppressed As Integer, _
UploadID As Integer, HoldingID As String) As Long
On Error GoTo Err_InsertHoldingData
'Normal variables
Dim strInitialDate As String
Dim strLoadDate As String
Dim strBatchDate As String
Dim strBirthDay As String
Dim rstInsertHoldingData As ADODB.Recordset
Dim cmInsertHoldingData As ADODB.Command
'Purchase Variables
Dim prmStoreCardHolder As ADODB.Parameter
Dim prmCDiorUser As ADODB.Parameter
Dim prmSkinCareFocusDry As ADODB.Parameter
Dim prmSkinCareFocusDehyd As ADODB.Parameter
Dim prmSkinCareFocusFirstSignAge As ADODB.Parameter
Dim prmSkinCareFocusVisibleAge As ADODB.Parameter
Dim prmSkinCareFocusFirm As ADODB.Parameter
Dim prmSkinCareFocusRadiance As ADODB.Parameter
Dim prmSkinCareFocusOil As ADODB.Parameter
Dim prmProdPurchBasics As ADODB.Parameter
Dim prmProdPurchAA As ADODB.Parameter
Dim prmProdPurchIOD As ADODB.Parameter
Dim prmProdPurchPrestige As ADODB.Parameter
Dim prmProdPurchFoundation As ADODB.Parameter
Dim prmProdPurchMakeUp As ADODB.Parameter
Dim prmProdPurchFF As ADODB.Parameter
Dim prmProdPurchMF As ADODB.Parameter
Dim prmProdPurch As ADODB.Parameter
Dim prmdteLoaded As ADODB.Parameter
Dim prmdteInitial As ADODB.Parameter
Dim prmdteBatchDate As ADODB.Parameter
Dim prmUploadID As ADODB.Parameter
Dim prmBatchName As ADODB.Parameter
Dim prmProdPurchCapture As ADODB.Parameter
Dim prmProdPurchNoAge As ADODB.Parameter
Dim prmProdPurchMove As ADODB.Parameter
Dim prmProdPurchBikini As ADODB.Parameter
Dim prmProdPurchBronze As ADODB.Parameter
'Report Date
Dim prmintReportDateURN As ADODB.Parameter
'Store Parameters
Dim prmStore As ADODB.Parameter
'Output Paramter
Dim prmResult As ADODB.Parameter
'Clear errors collection
Err.Clear
'Address Table Parameters
Set prmAddress1 = New ADODB.Parameter
With prmAddress1
.Direction = adParamInput
.Type = adChar
.Size = 50
.Value = Trim(Address1)
End With
Set prmPostcode = New ADODB.Parameter
With prmPostcode
.Direction = adParamInput
.Type = adChar
.Size = 11
.Value = Trim(Postcode) 'Has to be not null
End With
Set prmOrganisation = New ADODB.Parameter
With prmOrganisation
.Direction = adParamInput
.Type = adChar
.Size = 65
.Value = Trim(Organisation)
End With
Code:
Public Function UploadMainData() As Integer
On Error GoTo Err_UploadMainData
Dim strErr As String
Dim strErrSource As String
Dim intErr As Integer
Dim intRecCount As Integer
Dim rstResult As ADODB.Recordset
Dim lngResult As Long
'Err.Clear
'Populate rstResult recordset from either the new or repeat holding table
Set rstResult = SelectHoldingData(mvarintErrorRecs, mvarintSpecificErrorRec)
rstResult.MoveFirst
rstResult.MoveLast
intRecCount = rstResult.RecordCount
'Pope added 20020503
With rstResult
'Pope took out the connect from inside the loop statement 20020510
Call Connect
UploadMainData = 1
If mvaroptNew = True Then 'If the user has elected to upload New Data
.MoveFirst
Do Until .EOF
If IsDate(.Fields("txtInitialDate").Value) = True And IsDate(.Fields("txtBatchDate").Value) = True Then
lngResult = InsertHoldingData(CDate(.Fields("txtBatchDate").Value), .Fields("txtBatch").Value, _
.Fields("txtURN").Value, .Fields("txtTitle").Value, Left(Trim(.Fields("txtInitial").Value), 1), .Fields("txtSurname").Value, _
.Fields("txtCompany").Value, .Fields("txtPOBox").Value, .Fields("txtAdd1").Value, _
.Fields("txtAdd2").Value, .Fields("txtAdd3").Value, .Fields("txtLocality").Value, .Fields("txtTown").Value, _
.Fields("txtCounty").Value, .Fields("txtPostcode").Value, .Fields("txtDPS").Value, _
.Fields("txtCountry").Value, .Fields("txtCountryCode").Value, _
.Fields("txtPhone").Value, .Fields("txtEmail").Value, IIf(Len(.Fields("txtBirthday").Value) < 1, Null, .Fields("txtBirthday").Value), _
.Fields("txtAgeRangeTo25").Value, .Fields("txtAgeRangeTo35").Value, _
.Fields("txtAgeRangeTo45").Value, .Fields("txtAgeRangeTo55").Value, .Fields("txtAgeRangeTo65").Value, .Fields("txtAgeRangeOver65").Value, _
.Fields("txtDiorUser").Value, .Fields("txtStoreCard").Value, .Fields("txtDNM").Value, .Fields("txtDNT").Value, .Fields("txtDNE").Value, .Fields("txtDNTP").Value, _
CDate(.Fields("txtInitialDate").Value), _
.Fields("txtDry").Value, .Fields("txtDehyd").Value, .Fields("txtFirstAge").Value, _
.Fields("txtVisible").Value, .Fields("txtLOFirm").Value, .Fields("txtRadiance").Value, .Fields("txtOily").Value, .Fields("txtPPB").Value, _
.Fields("txtPPAA").Value, .Fields("txtPPIOD").Value, .Fields("txtPPP").Value, .Fields("txtPPF").Value, .Fields("txtPPMU").Value, _
.Fields("txtPPFF").Value, .Fields("txtPPMF").Value, .Fields("txtPPC").Value, .Fields("txtPPNA").Value, .Fields("txtPPM").Value, _
.Fields("txtPPBI").Value, .Fields("txtPPBR").Value, .Fields("txtValue").Value, .Fields("txtStoreNum").Value, _
0, mvarintUploadID, .Fields("HoldingID").Value _
)
DoEvents
frmImport.pbDataImport.Value = ((.AbsolutePosition / intRecCount) * 250) + 750
If lngResult = 0 Then UploadMainData = 0
.MoveNext
Else
DoEvents
frmImport.pbDataImport.Value = ((.AbsolutePosition / intRecCount) * 250) + 750
UploadMainData = 0
m_strLoadState = m_strLoadState & "Info: Insert Failed Holding in Rec: " & CLng(.Fields("HoldingID").Value) & vbCrLf
Call HoldingErrors(CLng(.Fields("HoldingID").Value), "Invalid Date", "New", 0)
.MoveNext
End If
Loop
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|