Vb6 Set Database
Hello,
How can I set the database to text file in VB6?
The following is for VB.Net but I couldn't find a way to set database in VB6.
' Set the TextFile database connection file name
CType(btFormat.DatabaseConnections("TextFileDB"), TextFile).FileName = "c:\NutritionInformationEurope.txt"
-
This is C# version. It works but I couldnt manage it to work in VB6.
Seagull.BarTender.Print.Database.TextFile tf = new Seagull.BarTender.Print.Database.TextFile(labelFormat.DatabaseConnections[0].Name);
tf.FileName = Path.GetFullPath("data.txt");
labelFormat.DatabaseConnections.SetDatabaseConnection(tf);
labelFormat.PrintSetup.ReloadTextDatabaseFields = true; // Fix when field order is different from design time
// Print
labelFormat.Print();
VB6 version: it runs without any error but does not print.
Dim btDb As BarTender.Database Set btDb = btKocanFormat.Databases.Item(1) btDb.textFile.FileName = App.Path & "\data.txt" btDb.textFile.UseFieldNamesFromFirstRecord = True btDb.textFile.FieldDelimiter = btDelimComma btKocanFormat.UseDatabase = True btKocanFormat.PrintOut False, FalseAny help?
0 -
Using Bartender, clearing and resetting the database on the format file solved the problem.
0
请先登录再写评论。
评论
2 条评论