No Records Found
I have an application that creates shipping labels using SQL Server 2008 & BarTender 10.0 SR4. The application creates a recordset and places the data into a table in the database. We have bartender configured with a static query to read the data from a single table to print our labels. We originally had the template set up with a DSN, but are trying to connect using OLE DB now instead. However, when we try to print, we keep getting an error that there are no records. Abandoning our application, I tried printing directly from the BarTender template, where I have made the following observations:
1.) When I go into Database Connection Setup, and go to the Browse tab, I see the 11 records that currently exist in the table.
2.) The template is set to print all records, but when I click Print, and click the Select Records button, the top of the window displays 1 of 11, which it should, but in the preview window it displays the first record from the database, and repeats it over and over. I clicked on the scroll bar on the right, and help Page Down and had it go all the way to 1000 at one point.
3.) I read in the forum that if you try and print a record number that doesn't exist in the recordset, for example try to print record 20, when there's only 15, you'll receive a No Records Error, so on a whim, instead of telling it to print All, I told it to print records 1-11, and voila, the labels print fine.
Thinking I might have some kind of corrupt data in one of the database connection settings, I then went through and removed all of the database connections, named data sources & vb scripts (i'm using 2 very simplistic scripts), saved the file, closed the file and reopened it, added the database connections, named data sources and vb scripts, and am still having the same issue.
BarTender seems to know that it's only dealing with 11 records, but when I tell it to print All, the recordset appears to be caught in some kind of infinite loop. Rewriting the application to pass the number of labels that need printing is not an option at this time. It runs fine from a DSN pointing to the database, but dies when I use OLE DB. Any ideas on what I'm doing wrong here?
Greg Groth
-
After more experimentation, I thought I would add the following. I've tried every OLE DB option possible with the same result. I then tried using ODBC with a connection string instead of a DSN with the same result. The only option that seems to work is ODBC with a DSN.
0 -
After fighting with this for 2 days, I stumbled upon my issue. Our shipping software was constructing an ASCII string of data for the MaxiCode and storing that in a table in our database. For our MaxiCode object, we were passing the string as a single Data Source / Database Field. This would work fine if connected to the database using a DSN or if using OLE DB or an ODBC connection string and specifying the precise number of records in the table. It would not work if we chose "All" under Selected Records, unless we used a DSN. I believe that the unreadable control characters in the ASCII string were somehow getting mangled or corrupted when connecting using OLE DB and causing BarTender to suffer some type of confusion when trying to print "All". We have since modified our data sources to use an Embedded Data type for the control characters in the ASCII string, and are pulling the readable characters from the database. I can now print using OLE DB or an ODBC connection string.
0 -
Thanks for the update Greg!
0
Please sign in to leave a comment.
Comments
3 comments