Vb6 Set Database 追蹤

0

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" 
 

 

2 意見

0
Avatar
Legacy Poster
評論操作 永久連結

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, False

 

Any help?

0
Avatar
Legacy Poster
評論操作 永久連結

Using Bartender, clearing and resetting the database on the format file solved the problem.

登入寫評論。