Re: [sqlite] Hello I am a newbie : for SQLite : Create db : VB6
Just open the file. palmer ristevski wrote: > I am new to this type of Forum.Here is my question : My development platform > is VB6. I am using "SQLitePlus COM-DLL" from ez-tools.com.They have code to > access and query an existing ".db" file, but I wish to know how to make a > function call to create new SQLite database files on harddisk.How would you > do this using VB6?What is the function call that you would have to make.I > know how to do this with SQLite at the command line, and I could use VB6 to > execute these commands at the command line, but I want a more direct way to > create new database files.Hope someone can help me out. > Pablopico> Date: Tue, 29 Apr 2008 20:32:32 +0200> From: [EMAIL PROTECTED]> > To: [EMAIL PROTECTED]> Subject: Re: Hello I am a newbie> > Hello Pablopico,> > > i am sorry, but i can not answer your question. I do not know VB. How > did > you find my eMail - address anyway?> > To join the sqlite mailing list, > visit> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users> > and > follow the instructions. Then post your questions by mailing them to> > > sqlite-users@sqlite.org> > Good luck,> Martin> > [EMAIL PROTECTED] wrote:> > > I am new to this type of Forum.> > I don't know how one is supposed to post > to this forum.> > I don't see a "POST" button on this site.> > Based on email > information I got from SQLite users, is this> > all done via 'email > posting'?> >> > Anyways, I also have a question.> > My development platform > is VB6. I am using "SQLitePlus COM-DLL" from > > ez-tools.com.> > They have > code to access and query an existing ".db" file, but I wish to know how to make a function call to create new SQLite database files on harddisk.> > How would you do this using VB6?> > What is the function call that you would have to make.> > I know how to do this with SQLite at the command line, and I could use VB6 to execute these commands at the command line, but I want a more direct way to create new database files.> >> > Hope you can help me out.> >> > Pablopico> >> >> > > > _ > Back to work after baby–how do you know when you’re ready? > http://lifestyle.msn.com/familyandparenting/articleNW.aspx?cp-documentid=5797498=T067MSN40A0701A > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Hello I am a newbie : for SQLite : Create db : VB6
Hello. I happened to see this thread (I'm EzTools suppport). The Sqlite open function automatically creates a new file if the file doens't exist. SqlitePlus does the same thing (since it just passes through to Sqlite). However, I have added an additional, optional parameter that will cause the SqliteDb.Open method to fail if the file doesn't exist. But it is false by default, so calling open with a filename that doesn't exist should create the file. Maybe its being created in a different folder than your .exe? Its possible its in a place you don't expect if you aren't passing a full path. Anyway, here is a good way to call SqliteDb.Open from a VB app: db.Open App.Path & "my_database.db", 0, false Let me know via my eddress if you still have problems ([EMAIL PROTECTED]). cheers -brett Quoting palmer ristevski <[EMAIL PROTECTED]>: > > That is Great OLAF > That is all that I am looking for. > I just want to be able to create new files, > then create tables and populate them and > do simple queries. > If I can do that with your stuff, that would be amazing > for me. I have had great great difficulty trying to find > wrapper for VB6! > Thanks once again. > I will try it out, and if I run into problems i will email you. > > Thanks once again. > > Pablopico > >> To: sqlite-users@sqlite.org >> From: [EMAIL PROTECTED] >> Date: Wed, 30 Apr 2008 03:17:30 + >> Subject: Re: [sqlite] Hello I am a newbie : for SQLite : Create db : VB6 >> >> palmer ristevski <[EMAIL PROTECTED]> writes: >> >> Hi Palmer, >> >> > I am new to this type of Forum.Here is my question : >> > My development platform is VB6. I am using "SQLitePlus >> > COM-DLL" from ez-tools.com.They have code to access >> > and query an existing ".db" file, but I wish to know >> > how to make a function call to create new SQLite >> > database files on harddisk.How would you do this using >> > VB6?What is the function call that you would have to make. >> > I know how to do this with SQLite at the command >> > line, and I could use VB6 to execute these commands >> > at the command line, but I want a more direct way to create >> > new database files.Hope someone can help me out. >> >> Sorry, no experience with the SQLitePlus-COM-wrapper >> (maybe you should ask their technical support). >> >> In case you want to try out something, working >> similar to "ADO/DAO-style"... >> The following example is Code for my COM-wrapper, >> which is available here: >> www.datenhaus.de/Downloads/dhRichClientDemo.zip >> It consists of three Binaries, placed in the >> Public Domain: >> dhRichClient.dll (COM-Dll - ADO-like WrapperClasses) >> sqlite35_engine.dll (StdCall-Dll, based on SQLite 3.5.7) >> DirectCOM.dll (Std-Dll, allows regfree COM-instancing) >> >> Small example how to use it, including the >> creation of a new DB, in case the file doesn't >> exists yet: >> >> Dim Cnn As cConnection, Cmd As cCommand, Rs As cRecordset >> Dim i As Long, FileName As String >> FileName = "c:MyFile.db" >> >> Set Cnn = New cConnection 'create a Cnn-Object >> >> On Error Resume Next >> Cnn.OpenDB FileName 'attempt, to open a DB-file >> If Err Then 'DB-File doesn't exists... >> Cnn.CreateNewDB FileName '...so we create one >> End If >> >> 'Ok, let's create a table >> Cnn.Execute "Create Table If Not Exists " & _ >> "Tbl(ID Integer Primary Key, Txt Text)" >> >> 'now we insert a few records over a Command-Object >> Set Cmd = Cnn.CreateCommand("Insert Into Tbl Values(?,?)") >> For i = 1 To 5 >> Cmd.SetText 2, "SomeText_" & i >> Cmd.Execute >> Next i >> >> 'and finally we request a Resultset... >> Set Rs = Cnn.OpenRecordset("Select * From Tbl") >> >> Do Until Rs.EOF 'loop over it... >> Debug.Print Rs!ID, Rs!Txt '...and print its contents >> Rs.MoveNext >> Loop >> >> >> Olaf Schmidt >> >> >> >> ___ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > _ > Express yourself wherever you are. Mobilize! > http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > This message was sent using IMP, the Internet Messaging Program. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Hello I am a newbie : for SQLite : Create db : VB6
That is Great OLAF That is all that I am looking for. I just want to be able to create new files, then create tables and populate them and do simple queries. If I can do that with your stuff, that would be amazing for me. I have had great great difficulty trying to find wrapper for VB6! Thanks once again. I will try it out, and if I run into problems i will email you. Thanks once again. Pablopico > To: sqlite-users@sqlite.org > From: [EMAIL PROTECTED] > Date: Wed, 30 Apr 2008 03:17:30 + > Subject: Re: [sqlite] Hello I am a newbie : for SQLite : Create db : VB6 > > palmer ristevski <[EMAIL PROTECTED]> writes: > > Hi Palmer, > > > I am new to this type of Forum.Here is my question : > > My development platform is VB6. I am using "SQLitePlus > > COM-DLL" from ez-tools.com.They have code to access > > and query an existing ".db" file, but I wish to know > > how to make a function call to create new SQLite > > database files on harddisk.How would you do this using > > VB6?What is the function call that you would have to make. > > I know how to do this with SQLite at the command > > line, and I could use VB6 to execute these commands > > at the command line, but I want a more direct way to create > > new database files.Hope someone can help me out. > > Sorry, no experience with the SQLitePlus-COM-wrapper > (maybe you should ask their technical support). > > In case you want to try out something, working > similar to "ADO/DAO-style"... > The following example is Code for my COM-wrapper, > which is available here: > www.datenhaus.de/Downloads/dhRichClientDemo.zip > It consists of three Binaries, placed in the > Public Domain: > dhRichClient.dll (COM-Dll - ADO-like WrapperClasses) > sqlite35_engine.dll (StdCall-Dll, based on SQLite 3.5.7) > DirectCOM.dll (Std-Dll, allows regfree COM-instancing) > > Small example how to use it, including the > creation of a new DB, in case the file doesn't > exists yet: > > Dim Cnn As cConnection, Cmd As cCommand, Rs As cRecordset > Dim i As Long, FileName As String > FileName = "c:\MyFile.db" > > Set Cnn = New cConnection 'create a Cnn-Object > > On Error Resume Next > Cnn.OpenDB FileName 'attempt, to open a DB-file > If Err Then 'DB-File doesn't exists... > Cnn.CreateNewDB FileName '...so we create one > End If > > 'Ok, let's create a table > Cnn.Execute "Create Table If Not Exists " & _ > "Tbl(ID Integer Primary Key, Txt Text)" > > 'now we insert a few records over a Command-Object > Set Cmd = Cnn.CreateCommand("Insert Into Tbl Values(?,?)") > For i = 1 To 5 > Cmd.SetText 2, "SomeText_" & i > Cmd.Execute > Next i > > 'and finally we request a Resultset... > Set Rs = Cnn.OpenRecordset("Select * From Tbl") > > Do Until Rs.EOF 'loop over it... > Debug.Print Rs!ID, Rs!Txt '...and print its contents > Rs.MoveNext > Loop > > > Olaf Schmidt > > > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _ Express yourself wherever you are. Mobilize! http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Hello I am a newbie : for SQLite : Create db : VB6
palmer ristevski <[EMAIL PROTECTED]> writes: Hi Palmer, > I am new to this type of Forum.Here is my question : > My development platform is VB6. I am using "SQLitePlus > COM-DLL" from ez-tools.com.They have code to access > and query an existing ".db" file, but I wish to know > how to make a function call to create new SQLite > database files on harddisk.How would you do this using > VB6?What is the function call that you would have to make. > I know how to do this with SQLite at the command > line, and I could use VB6 to execute these commands > at the command line, but I want a more direct way to create > new database files.Hope someone can help me out. Sorry, no experience with the SQLitePlus-COM-wrapper (maybe you should ask their technical support). In case you want to try out something, working similar to "ADO/DAO-style"... The following example is Code for my COM-wrapper, which is available here: www.datenhaus.de/Downloads/dhRichClientDemo.zip It consists of three Binaries, placed in the Public Domain: dhRichClient.dll (COM-Dll - ADO-like WrapperClasses) sqlite35_engine.dll (StdCall-Dll, based on SQLite 3.5.7) DirectCOM.dll (Std-Dll, allows regfree COM-instancing) Small example how to use it, including the creation of a new DB, in case the file doesn't exists yet: Dim Cnn As cConnection, Cmd As cCommand, Rs As cRecordset Dim i As Long, FileName As String FileName = "c:\MyFile.db" Set Cnn = New cConnection 'create a Cnn-Object On Error Resume Next Cnn.OpenDB FileName 'attempt, to open a DB-file If Err Then 'DB-File doesn't exists... Cnn.CreateNewDB FileName '...so we create one End If 'Ok, let's create a table Cnn.Execute "Create Table If Not Exists " & _ "Tbl(ID Integer Primary Key, Txt Text)" 'now we insert a few records over a Command-Object Set Cmd = Cnn.CreateCommand("Insert Into Tbl Values(?,?)") For i = 1 To 5 Cmd.SetText 2, "SomeText_" & i Cmd.Execute Next i 'and finally we request a Resultset... Set Rs = Cnn.OpenRecordset("Select * From Tbl") Do Until Rs.EOF 'loop over it... Debug.Print Rs!ID, Rs!Txt '...and print its contents Rs.MoveNext Loop Olaf Schmidt ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users