Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO problem 1

Status
Not open for further replies.

makys

Programmer
Dec 20, 2003
2
YU
I use following code to access datebase through ADO:


.
.
.
Set command = Server.CreateObject("ADODB.Command")
.
.
.
Set prmName = command.CreateParameter("Name")
command.Parameters.Append prmName
prmEntryID.value = Request.Form("Name")
.
.
.

Response is: Parameter object is improperly defined.
Inconsistent or incomplete information was provided.

What is missing??
 
Although the documentation doesn't make it clear, it seems you must set the [tt]Direction[/tt] property of the [tt]Parameter[/tt] object (and, possibly, the [tt]Type[/tt] property).

This can be done in the [tt]CreateParameter[/tt] call:
Code:
   Set prmName = command.CreateParameter("Name", adVarChar, adParamInput)

Or afterwards:
Code:
   Set prmName = command.CreateParameter("Name")
   With prmName
      .Direction = adParamInput
      .Type = adVarChar
   End With

Hope this helps

(I assume the [tt]prmEntryID[/tt] in your post is just a typo).

________________________________________
[hippy]Roger J Coult; Grimsby, UK
In the game of life the dice have an odd number of sides.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top