I've noticed that you mention both VB and VBS.  Is this something that you are 
eventually going to run from an actual VB application?  If so, you might be 
able to use a directory notification on the directory where the import is, then 
just trigger an action when the import file is deleted, which the .bat file 
could do after the import is done.  Or, if you don't want to be that drastic, 
monitor the specific file for a Rename event.  Of course, I don't know that VB 
6 supports this, but I know that VB.Net does.

--
Eric Pankoke
Founder / Lead Developer
Point Of Light Software
http://www.polsoftware.com/

 -------------- Original message ----------------------
From: "RB Smissaert" <[EMAIL PROTECTED]>
> Of course the .bat file could make a little file to notify VB.
> Still, running a loop to check for this is not ideal.
> 
> RBS
> 
> -----Original Message-----
> From: Griggs, Donald [mailto:[EMAIL PROTECTED] 
> Sent: 15 November 2006 19:37
> To: sqlite-users@sqlite.org
> Subject: RE: [sqlite] Importing text file via .bat file
> 
>  
> Echo  .mode csv                       >MyCommands.tmp
> Echo  .import ReadCode.txt ReadCode  >>MyCommands.tmp
> 
> Sqlite3 ReadCode.db ".read myCommands.tmp"
> 
> =============================
> -----Original Message-----
> From: RB Smissaert [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, November 15, 2006 1:13 PM
> To: sqlite-users@sqlite.org
> Subject: RE: [sqlite] Importing text file via .bat file
> 
> Hi Donald,
> 
> Thanks, but I don't quite get it yet.
> What is in this file MyCommand.tmp?
> Is there no way to put the whole thing in on .bat file or even better
> run the whole sequence from VB?
> 
> RBS
> ===============================
> ===============================
> 
> Regarding: "What is in this file MyCommand.tmp?"
> 
> The file, "MyCommand.tmp" would be a temporary file created by your
> batch file itself as it runs.
> 
> 
> 
> Regarding: "...one batch file...?"
> 
> In a sense, the entire logic *is* in one batch file, but it's true that
> a small, temporary file is created as part of the process, and you can
> delete it when done.  Unless you're doing this thousands of times an
> hour, the extra time introduced by having a temporary file will be
> minimal.
> 
> Kees Nyut showed a nicer syntax, one that I *thought* I had problems
> with for early versions of sqlite.exe under windows, but seems to work
> well now:
>  Instead of:
>       Sqlite3 ReadCode.db ".read myCommands.tmp"
>  use:
>       Sqlite3 ReadCode.db <myCommands.tmp
> 
> 
> Re: "..or VB?"     
>     I don't use Visual Basic, so I'm no expert, but the advantage of
> using the sqlite command-line utility (called sqlite3.exe) is that the
> code for parsing comma-delimited strings is built in.   If you have your
> routines for this, or want to incorporate the code from the sqlite
> command utility source, then you can certainly do everything within VB.
> 
> 
> Returning to the "single batch file" question:
> 
>      I've actually used a sneaky means of doing this, but it assumes
> you're pretty familiar with batch files.  It's more straightforward for
> unix scripts, but for windows, we start it with a line of
>     /*
> Which gives a (harmless) error when the batch file starts, but it allows
> us to treat the top portion of the file as a set of inputs to sqlite
> command utility.
> 
> -----beginning of file Mybatchfile.bat
> /*
> GOTO  :startit
>   This is a combination sql and batch file to .......
> */
> 
> /* Put all your sql commands and DOT commands here */
> drop table if exists ReadCode;
> create table ReadCode (
>   SUBJECT_TYPE varchar(5),
>   READ_CODE    varchar(5),
>   TERM30       varchar(30),
>   TERM60       varchar(60)
> );
> .mode csv
> .import ReadCode.txt ReadCode
> 
> -- end sqlite with .quit, but batch file continues
> .quit
> 
> == nothing runs in this space till we get to "startit"
> ====================
> 
> :Startit
> Rem  Beginning of batch file commands
> @echo off
> Rem clear the harmless error off the screen
> Cls
> 
> Rem [Do any other preparatory batch file commands here]
> 
> Rem Invoke sqlite3 command utility and submit the top of this batch file
> as a set of commands
> Rem we assume this entire batch file is named "Mybatchfile" and it's in
> our current directory.
> 
> Sqlite3 myData.db  <MyBatchFile.bat
> 
> Rem [ put here any windows batch commands we want after Sqlite3 leaves
> with the .quit command ]
> 
> ----end of mybatchfile.bat
> 
> 
> 
> ----------------------------------------------------------------------------
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> ----------------------------------------------------------------------------
> -
> 
> 
> 
> 
> -----------------------------------------------------------------------------
> To unsubscribe, send email to [EMAIL PROTECTED]
> -----------------------------------------------------------------------------
> 



-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to