Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2011
    Location
    Houston, TX
    Posts
    32

    Question Unanswered: ADO Command problems

    All I want to do is retrieve ONE column from ONE record in this dang database.
    Here's a code snippet:

    Code:
    Dim cmd As ADODB.Command
        Set cmd = New ADODB.Command
        Set cmd.ActiveConnection = conn
        With cmd
            .Properties("Jet OLEDB:Stored Query") = True
            .CommandText = "qryGetDatamapID"
            .CreateParameter "Datapath", adVarChar, 255, adParamInput
        End With
        
        Dim rst As ADODB.Recordset
        Set rst = New ADODB.Recordset
        rst.ActiveConnection = conn
        rst.CursorLocation = adUseClient
        Set rst = cmd.Execute(, , DmPath)
    The line highlighted in red gives me the error 3001 - Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

    I'm not sure if I'm just not using the command object right, or if I just ... don't know how to resolve the issue. The query in question only has ONE parameter, and it's text input.

    I've been trying to resolve this issue all day long. Any help would be most appreciated.

    Thanks

    Edit:
    Okay I've changed it to this:
    Code:
    Dim cmd As ADODB.Command
        Set cmd = New ADODB.Command
        Set cmd.ActiveConnection = conn
        With cmd
            .CommandType = adCmdStoredProc
            .CommandText = "qryGetDatamapID"
            .CreateParameter "Datamap", adVariant, adParamInput
        End With
        
        Dim rst As ADODB.Recordset
        Set rst = New ADODB.Recordset
        rst.ActiveConnection = conn
        rst.CursorLocation = adUseClient
        cmd.Parameters("Datamap").Value = DmPath
        
        Set rst = cmd.Execute
    And now the error is thrown at the red line above, only now it's Error 3265 "Item cannot be found in the collection corresponding to the requested name or ordinal"

    I ... am coming to my wit's end with this.
    Last edited by asherman86; 03-07-13 at 16:35.

  2. #2
    Join Date
    Nov 2011
    Location
    Houston, TX
    Posts
    32
    Forget it, I just imported the whole freaking table and filtered it. If anyone comes up with a solution to this though, I'd love to hear it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •