ADO Parameter Problm 
Author Message
 ADO Parameter Problm

Hello

The only thing I can think of is the slight chance you left out

objCmd.CommandType = adCmdStoredProc
or
objCmd.ActiveConnection = connection_object

I'm sure you have those in the code though...? I don't suppose there is a
chance that you need 0 in the place in CreateParameter(...   , ,  )  where
you use two commas- you can tell I'm not an MVP, but quite new too

It might help if you use the following function, which you call by saying
printparameters("update_test_query"). It uses refresh, in case you don't
know of this, and that looks into the db and retrieves the parameter info
the db expects..

private sub printparameters(s_proc_name) ' debugging

dim conn, adoCmd, adoParam
dim iCtr

set conn = server.CreateObject("ADODB.Connection")
conn.Open "vbstyle"
set adoParam = server.CreateObject("ADODB.Parameter")
set adoCmd = server.CreateObject("ADODB.Command")

    With adoCmd
        Set .ActiveConnection = conn
        .CommandText = s_proc_name
        .CommandType = adCmdStoredProc
        .Parameters.Refresh
        Response.Write("<BR>")
        Response.Write("Procedure " & SP & ", Parameters = " &_
.Parameters.Count & "<BR>" & "<BR>")
        For iCtr = 0 To .Parameters.Count - 1

        select case .Parameters(iCtr).Type
        case 3:
         thetype = "adInteger"
        case 5:
         thetype="adDouble"
        case 11:
         thetype="adBoolean"
        case 129:
         thetype="adChar"
        case else
         thetype = CStr(.Parameters(iCtr).Type)
        end select

        select case .Parameters(iCtr).Direction
        case &H0001:
         thedir = "adParamInput"
        case &H0002:
         thedir="adParamOutput"
        case else
         thedir = CStr(.Parameters(iCtr).Direction)
        end select

            Response.Write("Param: " & .Parameters(iCtr).Name & " = " &_
.Parameters(iCtr).Value & " type " & thetype & " Direction " & thedir &
"<BR>")
        Next
        Response.Write("<BR>")
    end with

end sub

Cheers

Justin Dutoit



Sun, 13 Jul 2003 02:45:46 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Problm while running the Project: The program has exited with code 0

2. a problm of communication ASP and ASP+

3. Help - Printing Problm

4. Help : problm with ODBC and Win95

5. Plz Help.... Printing Problm In Visual Basic 4.0

6. MAPI problm: no transport on msg send

7. HELP: Group problm with three 1:n entities

8. ADO ADO ADO ADO ADO VB examples / samples book wanted

9. ADO: Running a stored procedure that takes parameters (?!?!?)

10. ADO Read-write parameter query recordsets

11. MS Access parameter queries using VID and ADO

12. comparing ADO parameter direction problem

 

 
Powered by phpBB® Forum Software