Hi,
I'm trying to write data to a SQL Server 7 DB. No matter what I try I keep getting the same error:"The application has improperly defined a parameter object".
I don't understand why I keep getting this problem, after all I used the exact same coding in a previous project and it worked 100%.
I'm using the following code:
Dim oConn As Object
Dim cmUpdTop As Object
'Open a connection to the EDIBILLING DSN
Set oConn = CreateObject("ADODB.Connection"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
oConn.Open "DSN=EDIBILLING;UID=sa"
' Instantiate the command for cmUpdateTop20 object
Set cmUpdTop = CreateObject("ADODB.Command"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Set cmUpdTop.ActiveConnection = oConn
'Build insert statement for
cmUpdTop.CommandText = "INSERT INTO MonthlyTop20 _(Month ,Position, Customer, Volume) VALUES (?,?,?,?)"
cmUpdTop.Prepared = True
With cmUpdTop
.Parameters.Append .CreateParameter("Month", adChar, ,_ 15)
.Parameters.Append .CreateParameter("Position",_ adInteger, , 9)
.Parameters.Append .CreateParameter("Customer",_ adChar, , 50)
.Parameters.Append .CreateParameter("Volume",_ adInteger, , 9)
End With
If anyone can shed some light on the situation for me, it would be greatly appreciated.
thanx
mike
I'm trying to write data to a SQL Server 7 DB. No matter what I try I keep getting the same error:"The application has improperly defined a parameter object".
I don't understand why I keep getting this problem, after all I used the exact same coding in a previous project and it worked 100%.
I'm using the following code:
Dim oConn As Object
Dim cmUpdTop As Object
'Open a connection to the EDIBILLING DSN
Set oConn = CreateObject("ADODB.Connection"
oConn.Open "DSN=EDIBILLING;UID=sa"
' Instantiate the command for cmUpdateTop20 object
Set cmUpdTop = CreateObject("ADODB.Command"
Set cmUpdTop.ActiveConnection = oConn
'Build insert statement for
cmUpdTop.CommandText = "INSERT INTO MonthlyTop20 _(Month ,Position, Customer, Volume) VALUES (?,?,?,?)"
cmUpdTop.Prepared = True
With cmUpdTop
.Parameters.Append .CreateParameter("Month", adChar, ,_ 15)
.Parameters.Append .CreateParameter("Position",_ adInteger, , 9)
.Parameters.Append .CreateParameter("Customer",_ adChar, , 50)
.Parameters.Append .CreateParameter("Volume",_ adInteger, , 9)
End With
If anyone can shed some light on the situation for me, it would be greatly appreciated.
thanx
mike