Alpha Video Training
Results 1 to 2 of 2

Thread: Xbasic code not working with MySQL

  1. #1
    Real Name
    Ben Wirch
    Join Date
    Aug 2009

    Default Xbasic code not working with MySQL

    I am not a real proficient Alpha programmer but know just enough to be dangerous. We upgraded from ver 4.5 to ver 9 a few months ago and had a few minor issues to work out. One was a form that prints an Install sheet for new customers. I finally was able to get the form to print from a button using the xbasic code below.

    current_record = alltrim(str(recno(),10,0))
    :Report.print("Wireless Install","BETWEEN(RECNO(),"+ current_record+ "," + current_record+")")
    goto cleanup

    We then converted our Data to a backend MySQL Database for an application running on one or Linux severs managed by a third party and now the script does not print the proper record when doing a sort and find by key.

    The form will prinf if you scroll to the desired record and don't do a search.

    Any help would be appreciated.

  2. #2
    "Certified" Alphaholic
    Real Name
    Peter Wayne
    Join Date
    Apr 2000

    Default Re: Xbasic code not working with MySQL

    There is no such thing as "recno()" for a SQL backend, whether MySQL or any other SQL database. SQL tables do not keep track of the absolute physical position of a record. What you can do instead is to create an auto_increment integer field for the MySQL table -- call it "recnum" if you like -- and then create a "recnum" integer field in the active-linked Alpha Five table. Then you can use the between() function with "recnum" instead of "recno()".

Similar Threads

  1. MySql Bckup Xbasic
    By Walter in forum Alpha Five Version 9 - Desktop Applications
    Replies: 3
    Last Post: 03-11-2009, 08:22 AM
  2. Working with MySql
    By mschoi in forum Alpha Five Version 8
    Replies: 15
    Last Post: 12-04-2007, 01:43 PM
  3. a5 web security working with mysql
    By mschoi in forum Alpha Five Version 8
    Replies: 2
    Last Post: 06-19-2007, 03:55 PM
  4. difficulty working with mysql or sql backend?
    By Jason Wilson in forum Alpha Five Version 5
    Replies: 0
    Last Post: 04-10-2004, 07:08 PM
  5. Xbasic context help in code editor is not working
    By Marcel Kollenaar in forum Alpha Five Version 5
    Replies: 3
    Last Post: 05-31-2003, 01:01 AM


Posting Permissions

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