|
-
Jan 11th, 2003, 09:17 AM
#1
Thread Starter
Member
What is the wrong in this code?
I use this code in a class to insert row in table:-
'********************
Public Sub hosptINSERT(FRM As Object, C As Object)
Set Cmd = New ADODB.Command
With Cmd
.ActiveConnection = cn
.CommandText = "prd_insert_HOSPT"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("@HOSPNAME_1", adVarChar, 1, 10, C(0).Text)
.Parameters.Append .CreateParameter("@FULLNAME_2 ", adVarChar, 1, 50, C(1).Text)
.Parameters.Append .CreateParameter("@AHOSPNAME_3", adVarChar, 1, 50, C(2).Text)
End With
End Sub
'********************
WHEN I TRAY TO RUN IT ,I FACE THES MSG:-'Must specify index for object array'
never i can not say 'NO' for u until u aske me to leave u...
-
Jan 11th, 2003, 10:00 AM
#2
Frenzied Member
which line does Debug give the error on?
There are 3 types of people in this world.........those that can count, and those that can't.
Blobby
-
Jan 11th, 2003, 10:04 AM
#3
PowerPoster
you don't say what "cn" is. Is it an object array?
-
Jan 11th, 2003, 02:54 PM
#4
Thread Starter
Member
The object array is c(0),c(1) and c(3)
never i can not say 'NO' for u until u aske me to leave u...
-
Jan 11th, 2003, 03:27 PM
#5
Frenzied Member
There are 3 types of people in this world.........those that can count, and those that can't.
Blobby
-
Jan 11th, 2003, 03:51 PM
#6
Thread Starter
Member
So what can i do? How can i solve it? i need it to work in a class.
never i can not say 'NO' for u until u aske me to leave u...
-
Jan 11th, 2003, 04:20 PM
#7
Frenzied Member
What is your code when you call this "hosptINSERT" sub?
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
|