跳到主内容

搜索

搜索

Problem Adding Query To Database

评论

3 条评论

  • Avatar
    Shotaro Ito
    Hi WestNab,

    do you use custom query?
    Usually Excel sheet name comes with '$' char after sheet name 'Sheet1$' in OLEDB, So populated query will be like
    [sql]SELECT * FROM `Sheet1$` WHERE `REF` = '?ref'[/sql]
    (when query prompt "ref" is specified.)

    also make sure you closed MS Excel (or at least no one else open the excel file) when connect / print by BarTender.

    For CSV data, try quote value by ""(double quotation) to prevent incorrect import.
    [sql]"FNAME","LNAME","AGE"
    "John","doe","28"[/sql]

    Hope that helps!
    0
  • Avatar
    Legacy Poster
    [quote name='Shotaro I -Seagull Support' timestamp='1314325353' post='451']
    Hi WestNab,

    do you use custom query?
    Usually Excel sheet name comes with '$' char after sheet name 'Sheet1$' in OLEDB, So populated query will be like
    [sql]SELECT * FROM `Sheet1$` WHERE `REF` = '?ref'[/sql]
    (when query prompt "ref" is specified.)

    also make sure you closed MS Excel (or at least no one else open the excel file) when connect / print by BarTender.

    For CSV data, try quote value by ""(double quotation) to prevent incorrect import.[attachment=293:rioPro-a-2012.btw]
    [sql]"FNAME","LNAME","AGE"
    "John","doe","28"[/sql]

    Hope that helps!
    [/quote]

    No, sorry it didn't ... and we have the same problem this year! Excel is closed. DB connection is linked to Excel (97-2003 format) file "cards12a.xls" with sheet called "cards":

    [sql]SELECT EXAMREF,NAME,BIRTHDAY,BARCODE,PHOTO FROM `cards$` WHERE `EXAMREF`='?Examref'[/sql]

    If I untick 'Use custom SQL query' then I can browse the data fine. But I need to define the user prompt for efficient workflow when processing 30 students tomorrow & 1000 students on Tuesday 28th!
    0
  • Avatar
    Ian Cummings
    版主
    Drop the quotes from around the query prompt name:

    [code]
    SELECT EXAMREF,NAME,BIRTHDAY,BARCODE,PHOTO FROM `cards$` WHERE `EXAMREF` = ?Examref
    [/code]
    0

请先登录再写评论。