Alpha Video Training
Results 1 to 2 of 2

Thread: MYSQL stored procedure

  1. #1
    Member
    Real Name
    Alan Sawyer
    Join Date
    Apr 2006
    Location
    western New York (rural)
    Posts
    261

    Default MYSQL stored procedure

    I am trying to retrieve 1 big field of data from a mysql stored procedure in my validate event of a dialog component.
    I am getting this error.
    Errors in: event.Form Level Validate code:
    OLE Automation Error. Source is Microsoft OLE DB Provider for ODBC Drivers."
    ODBC driver does not support the requested properties."

    I'm not sure at what point it's happening, as I haven't figured out a good way to debug my code yet, but this is the code in the event.
    I have replaced the username and password with fake information. I had grabbed this code from a couple of posts that David Brown had, so I'm sure part of it may be redundant, but I am combining his two pieces of code into one.
    Code:
    dim Conn as P
    dim rs as P
    dim sql as C
    
    conn = ole.create("ADODB.Connection")
    rs = ole.create("adodb.recordset")
    dim connection_string as c
    
    connection_string = "Provider=MSDASQL.1;Password=xxxx;User ID=root;Persist Security Info=False;Data Source=ASBO"
    
    conn.connectionstring = connection_string
    
    
    dim rs as P
    rs = ole.create("adodb.recordset")
    rs.cursortype = 3
    conn.open()
    sql = "sp_getaddress(34,null,null,null,null,null,null,null,null,null,null,null,null,null)"
    
    rs.open(sql,conn)
    txtBusname = rs.fields.item(0).value
    I have a data bound dropdownbox that uses the same database and I grabbed the connection string from that piece of code, so I believe it should work. I added userid and password to it, as it wasn't in it before.

    Any help would greatly be appreciated, as I'm needing to finish this little piece so I can show someone a websearch that I'm doing.

    Thanks again,
    Alan Sawyer
    Last edited by AaronBBrown; 06-28-2006 at 09:39 AM.

  2. #2
    Member
    Real Name
    Alan Sawyer
    Join Date
    Apr 2006
    Location
    western New York (rural)
    Posts
    261

    Default

    I feel like I'm so close. I am getting an unrecognized function error.
    The following code is in my validate event on my dialog component.
    I used the standard sql_connect.a5w that is on page 363 of the Web Reference guide, but I'm trying to use MYSQL instead of sql server.



    Code:
    dim session.MyText as C
    
    a5w_include("sql_connect.a5w")
    
    dim rs as P
    rs = ole.create("adodb.recordset")
    rs.cursortype = 3
    conn.open()
    sql = "sp_getaddress(34,null,null,null,null,null,null,null,null,null,null,null,null,null)"
    
    rs.open(sql,conn)
    session.mytext = rs.fields.item(0).value
    
    Response.redirect("results.a5w")

Similar Threads

  1. dialog procedure help please
    By gkeramidas in forum Alpha Five Version 7
    Replies: 4
    Last Post: 12-12-2005, 05:25 PM
  2. Need a little help writing a small procedure
    By Dave Wilson in forum Alpha Five Version 6
    Replies: 11
    Last Post: 10-01-2004, 06:05 AM
  3. end user compacting procedure
    By dik_coleman in forum Alpha Five Version 5
    Replies: 6
    Last Post: 08-02-2004, 02:49 AM
  4. invalid procedure call or argument
    By Vasanth in forum Alpha Five Version 5
    Replies: 2
    Last Post: 05-15-2003, 10:30 PM
  5. Ideal Upgrade Procedure
    By JohnFabrega in forum Alpha Five Version 5
    Replies: 3
    Last Post: 08-07-2002, 07:53 AM

Bookmarks

Posting Permissions

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