vb6 - How to select a file automatically? -


Use of VB6

Now I am using a browse button in my software, text To select the file, then it has been converted to MDB (Access). I do not want to select text file.

Once I install my software in any system, the text file will automatically select in the specified path. Then the text file is automatically converted to MDB once it is converted to MDB

Vb code to convert MBB to text.

  In the form of slow DB database, Table DB = DBeijin Set the OpenDatabase (App.Path & amp;; "\ History.mdb") tbl = db.CreateTableDef ("Temp") tbl.connect = "text; database =" & amp; App.Path & amp; "/ Convert /" TBL SourceTebName = Strawptup & amp; ".txt" db.TableDefs.Append tbl db.Execute "Select Temp.ID, Temp.IDTerminal, Temp.Reader, Temp.Date, Temp.Time, Temp.Cardnumber" & amp; StrOutput & amp; "Temp" db.TableDefs.Delete ("Temp") db. Close MsgBox strOutput sql2 = "Select from Events" Select from & amp; StrOutput & amp; "" If R.T.T. 1 Then R. Close RussLock Open SKL2, CN, Adopenstatic, AdLockoptimistic Set TBL = None Set DB = None  

The above code is working for MDB conversion.

For example,

MDB is name - history. The name of the MDB and table is - event.mdb

I like this in a "C: \ NewFolder "Setting up my software

In the above folder, the text file will appear with different names. Text file per day will appear 10 to 20 text files with new names. I can not even name the text file. I only have to give an extension like (* .txt)

After installing my software, the software should choose the text file from c: \ NewFolder, then it automatically gets converted to MDB, the text After changing the file, the text file should be automatically deleted.

Expected output

  After installing your software in any system, the software should choose a text file from a specific folder, then convert the text file into MDB needed. Once changed, delete the text files automatically from the specified path.  

The code has been changed to convert text to MDB, I need a sample code or idea to automatically select a text file

New in VB6 Anyone can give some idea how to do it or post a sample code for automatic selection of text files.

Please.

The original code will appear below the lines of this:

  String file name as dull filename = Dir $ ("C: \ NewFolder \ * .txt", vb directory), however the file name & lt; & Gt; "" Debug Print Filename 'This line file will be deleted when you ask' but it is the responsibility of your code to completely 'C: \ NewFoulder \' & amp; to ensure that the file is converted to MDB. The file name = filename = Dir $ loop  

The above code assumes that you will not have * .txt files and any other files or folders in your C: \ NewFolder.

HH


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -