Results 1 to 2 of 2

Thread: Parametrized Queries

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    12

    Angry

    Hello Everybody

    I have an access database "test.mdb" . in it i have
    modules as
    module1:
    public function sinevalue (value as double) as double
    sinevalue = sin (value)
    end function

    query as
    query1:
    SELECT sinevalue (?) As Expr1 From CorrectTable;

    I wrote a VB program which uses ADO to connect to the database as :

    Private Sub Form_Load
    dim cnn as new adodb.connection
    dim cat as new adox.catalog
    dim cmd as new adodb.cmd
    dim rs as new adodb.recordset

    with conn
    .Provider = "Microsoft.Jet.OLEDB.4.0"
    .Open "c:\data\correct.mdb"
    end with

    cat.activeconnection = conn

    set cmd = cat.Procedures(0).Command

    cmd.CommandType = adCmdStoredProc

    set rs = cmd.Execute (,"CorrectTable!FieldX")

    end sub

    I get an error in Cmd.Execute as " Undefined Function sinevalue in expression" can someone kindly tell me how to get over this and use the functions in the database ? or can I have the function in the local vb program and get it working ?

    thanks a lot

    sincerely

    sathza

  2. #2
    New Member
    Join Date
    Jan 2001
    Location
    Brussels (Belgium)
    Posts
    7
    Chumma,

    by using ADO, you're not able anymore to use the funny SQL syntax of ACCESS. If you wish to use the query, you have to use DAO instead.

    I think that's the only way to get a solution to your problem

    regards
    _________________________________
    JIEF

Posting Permissions

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



Click Here to Expand Forum to Full Width