I am pretty new to all of this and am working on a macro to transfer some data. I am using "Select Case" and when it reaches .Paramater.Append prm(i) is throws the "Invalid Object error". I don't even know where to start trouble shooting this? I'm a novice and need some help. Thanks! -
If Len(sSQL) > 0 Then
-
Set cmd = New ADODB.Command
-
With cmd
-
.ActiveConnection = con
-
.CommandText = sSQL
-
.CommandType = adCmdStoredProc
-
For i = 0 To 39
-
If aryData(i) = "" Then aryData(i) = Null
-
Select Case i
-
Case 0 To 2
-
Set prm(i) = .CreateParameter("@" & aryNames(i), adInteger, adParamInput, , aryData(i))
-
Case 3 To 14
-
Set prm(i) = .CreateParameter("@" & aryNames(i), adCurrency, adParamInput, , aryData(i))
-
Case 15 To 23
-
Set prm(i) = .CreateParameter("@" & aryNames(i), adDecimal, adParamInput, , aryData(i))
-
prm(i).Precision = 18
-
prm(i).NumericScale = 4
-
Case 24 To 33
-
Set prm(1) = .CreateParameter("@" & aryNames(i), adBoolean, adParamInput, 0, aryData(i))
-
Case 34 To 34
-
Set prm(i) = .CreateParameter("@" & aryNames(i), adVarChar, adParamInput, 100, aryData(i))
-
Case 35 To 38
-
Set prm(i) = .CreateParameter("@" & aryNames(i), adDecimal, adParamInput, , aryData(i))
-
prm(i).Precision = 18
-
prm(i).NumericScale = 4
-
Case 39 To 39
-
Set prm(i) = .CreateParameter("@" & aryNames(i), adCurrency, adParamInput, , aryData(i))
-
-
End Select
-
-
'OBJECT IS NO LONGER VALID ERROR???
-
-
.Parameters.Append prm(i)
-
-
-
Next
-
-
.Execute
-
End With
-
Set cmd = Nothing
-
End If
-
1 1827
What is prm?
I don't see it defined in the code that you have posted.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: David |
last post by:
My email application was working a couple of weeks ago,
then all of a sudden I get
Error Type:
(0x8009000F)
Object already exists.
I checked the permissions on the machinekeys directory...
|
by: Uttam |
last post by:
Hello,
How does one suppress the "Object already exists" message when the
following statement is executed in ADO?
cat.Views.Append "Some_Query", cmd
Thanks in advance.
Uttam
|
by: Nak |
last post by:
Hi there,
I am trying to make a collection that will work in the "Object
collection editor" dialog. I have implimeneted ICollection, IList and
IEnumerable and now I have an "unnamed"...
|
by: Mike Cooper |
last post by:
There is something about inherited classes I evidently don't know...
I wrote the following class:
Class Class1
inherits System.Windows.Forms.DataGridTextBoxColumn
End Class
There is...
|
by: =?Utf-8?B?R2FicmllbCBNw6luZGV6?= |
last post by:
Hello everyone.
I have a small class that encapsulates some functionallity to work with the
RSACryptoServiceProvider. Here is the code of the class i'm using:
public class dsRSA
{
private...
|
by: boliches |
last post by:
I have a form within my database which On Open (event procedure) will make many calculations and enter the results in text boxes on the page of the form (I have 2 tabs on this particular form). My...
|
by: Tarantulus |
last post by:
if("dept"=='dept'){
document.getElementById('add').style.display='none';
};
<DIV id="add">
<some html here..>
</DIV>
|
by: webgenius |
last post by:
Whenever I click the SUBMIT button in my HTML page, I get the "Object not found!" error. It was working fine yesterday. This error started to occur after I installed Codelobster and made some changes...
|
by: tlhintoq |
last post by:
I'm pretty sure this is language independent and is going to be the same whether it's VC or C# - but my project is C# WIndows Forms just in case.
Does anyone have a good handle on the sequence of...
|
by: peachdot |
last post by:
Just wondering..what should i do if this error came out?
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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...
|
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,...
|
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...
|
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: 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...
| |