Results 1 to 2 of 2

Thread: Maybe FAQ: Bind numeric parameter into ADODB Command Object

  1. #1
    Anthony Lee Guest

    Maybe FAQ: Bind numeric parameter into ADODB Command Object

    Hi! All ADO experts:

    I have a simple question but don't know how to solve it.

    Once I had created a Command Object and assigned a SQL
    statement with anonymous '?" Parameters, then I assign
    Command Parameter Object to *BIND* the value.

    Here is my example
    SELECT ID FROM BASE WHERE ID = ? OR SUBSTRING(ID, 1, LEN(?)) = ? + '-'

    Append.Paramter("ID1", adVarChar, , 255)
    Append.Paramter("ID2", adVarChar, , 255)
    Append.Paramter("ID3", adVarChar, , 255)

    In fact, three "?" marks indicated a same given value. That is,

    Command("ID1&#34 = XID
    Command("ID2&#34 = XID
    Command("ID3&#34 = XID

    However, the 2nd parameter binding is failed and OLEDB Provider
    reports there is a syntax error. How do I know the 2nd parameter
    has something wrong with it? I checked the other 2 parameter binding
    style and nothing wrong with them.

    Do you know any correct method to bind a parameter with an argument of
    build-in function call? Or I just missed something?

    Do very appreciate about your kind help. Please reply your message
    both on Newsgroup and my personal mail.

    Best regards,
    Anthony

    --
    class Sig { static char *unit, *mkt_mail, *web_mail, *http; };
    char *Sig::unit = "ASUSTeK Technical Support Division";
    char *Sig::mkt_mail = "mailto:info@asus.com.tw";
    char *Sig::web_mail = "mailto:webmaster@asus.com.tw";
    char *Sig::http = "http://www.asus.com.tw/Company/support-news.html";

  2. #2
    John Guest

    Maybe FAQ: Bind numeric parameter into ADODB Command Object (reply)

    Hi Anthony,

    You may have better luck posting this question in the ASP Development forum?

    Thanks,
    John


    On 12/2/98 1:32:48 AM, Anthony Lee wrote:
    > Hi! All ADO experts:

    I have a simple question but don't know how to
    > solve it.

    Once I had created a Command Object and assigned a
    > SQL
    statement with anonymous '?" Parameters, then I
    > assign
    Command Parameter Object to *BIND* the value.

    Here is my
    > example
    SELECT ID FROM BASE WHERE ID = ? OR SUBSTRING(ID, 1, LEN(?)) = ? +
    > '-'

    Append.Paramter("ID1", adVarChar, ,
    > 255)
    Append.Paramter("ID2", adVarChar, ,
    > 255)
    Append.Paramter("ID3", adVarChar, , 255)

    In fact, three
    > "?" marks indicated a same given value. That
    > is,

    Command("ID1&#34 = XID
    Command("ID2&#34 =
    > XID
    Command("ID3&#34 = XID

    However, the 2nd parameter binding is
    > failed and OLEDB Provider
    reports there is a syntax error. How do I know
    > the 2nd parameter
    has something wrong with it? I checked the other 2
    > parameter binding
    style and nothing wrong with them.

    Do you know any
    > correct method to bind a parameter with an argument of
    build-in function
    > call? Or I just missed something?

    Do very appreciate about your kind
    > help. Please reply your message
    both on Newsgroup and my personal
    > mail.

    Best regards,
    Anthony

    --
    class Sig { static char *unit,
    > *mkt_mail, *web_mail, *http; };
    char *Sig::unit = "ASUSTeK Technical
    > Support Division";
    char *Sig::mkt_mail =
    > "mailto:info@asus.com.tw";
    char *Sig::web_mail =
    > "mailto:webmaster@asus.com.tw";
    char *Sig::http =
    > "http://www.asus.com.tw/Company/support-news.html";

Posting Permissions

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