Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 5 of 5

Thread: SQL report help

  1. #1
    Join Date
    Oct 2003
    Location
    West Monroe, LA
    Posts
    294

    SQL report help

    Need help with this code.

    I run a query based on what the user selected and pull all data that matches the query DECRYPTIT then send to a grid object. It's not working correct.

    I get random results. If i select recordid and name only the name is displayed but in the record id column and nothing is in the name field.

    PLEASE HELP.


    PHP Code:
    if sqlString ~= "" then
        tbResults 
    SQLite.QueryToTable(dbsqlString);
        
        
    TextFile.WriteFromString("AutoPlay\\Docs\\report.csv"headerString .."\r\n"false);

        for 
    nRow =1tbResults.Rows do

            
    sRowData "";
            
            for 
    nCol 1tbResults.Columns do
                
                
    sRowData =  Crypto.BlowfishDecryptString(tbResults.Data[nRow][tbResults.ColumnNames[nCol]],"passoword")
                
    sRowDataString.Replace(sRowData"\r\n"" ");
                
    sRowDatasRowData ..",";
            
    end  
            
            TextFile
    .WriteFromString("AutoPlay\\Docs\\report.csv"sRowData .."\r\n"true);
        
        
    end    
        DialogEx
    .Show("ReportResults"truenilnil);
    end 
    SELECT * FROM Users WHERE IQ > 0;
    o rows Returned

  2. #2
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    With your code sRowData will only ever contain data from one column. Try this

    Code:
    sRowData = sRowData..Crypto.BlowfishDecryptString(tbResults.Data[nRow][tbResults.ColumnNames[nCol]],"passoword") 
    sRowData = String.Replace(sRowData, "\r\n", " "); 
    sRowData= sRowData ..",";
    Why not just put the data straight into the grid instead of writing out to a file?
    Dermot

    I am so out of here

  3. #3
    Join Date
    Oct 2003
    Location
    West Monroe, LA
    Posts
    294
    That did work, thanks BUT the record ID is blank.

    I couldn't get the data to the grid with the header without writing it to a csv file first. Man if you can help with that to that would be greatly appreciated.
    SELECT * FROM Users WHERE IQ > 0;
    o rows Returned

  4. #4
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Without knowing what the database looks like, its hard to know. Maybe post your app or at least a scaled down version.
    Dermot

    I am so out of here

  5. #5
    Join Date
    May 2006
    Posts
    5,380
    I couldn't get the data to the grid with the header without writing it to a csv file first. Man if you can help with that to that would be greatly appreciated.
    look at the below example, it contains some functions for loading sqlite directly into the grid

    http://www.indigorose.com/forums/sho...15&postcount=7
    Open your eyes to Narcissism, Don't let her destroy your life!!

Posting Permissions

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