how to use sqlite from classic ASP with no installation...

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

how to use sqlite from classic ASP with no installation...

Dominique Lagree
Hello,
I have a classic ASP application running on Windows / IIS to provide that would use an sqlite database.
It works fine on my Windows 7 laptop accessing the database using odbc driver.
BUT therefore I had to install the odbc driver and needed admin rights to do this install.

The person who asked for this application wants the application to be operationnal on a Windows server 2003 without any installation at all (he doesn't have installation rights and , for personal reasons (conflict with the administrator), it is IMPOSSIBLE for him to have an ODBC driver or anything else installed  on the server)

The only rights he has is R/W on IIS applications folders and access to inetmgr.

SO the question is :
How can we access to sqlite through an interface (oledb ?) that could be called from classic ASP vbscript and could run just from a copy to the application forder or a standard default driver or provider that would be available on a windows server 2003 ?



_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: how to use sqlite from classic ASP with no installation...

Olaf Schmidt-2
Am 24.06.2016 um 10:48 schrieb Dominique Lagree:

> I have a classic ASP application running on Windows / IIS to provide that would use an sqlite database.
> ...
> How can we access to sqlite through an interface (oledb ?) that could be called from
> classic ASP vbscript and could run just from a copy to the application forder or a standard
> default driver or provider that would be available on a windows server 2003 ?
>

You cannot call any "Standard-dll" from *.asp or VBScript directly
(not without a COM-wrapper around that Dll).

And although ADO is available (as creatable COM-based Environment),
you will not be able to bring any ADO->ODBC-Connectionstring to
work (e.g. with Werners ODBC-driver), as long as this ODBC-driver
is not properly registered in the registry (to be recognizable
and loadable "by ConnectionString" with the ADODB.Connection-Object).

However, there might be a way out, since at least on IIS7 to IIS8 a:
<%
Response.Write CreateObject("Microsoft.Windows.ActCtx") Is Nothing
%>

... will report a nice "False" back into the Browser.

Not sure, which version of IIS comes on Win-2003-Server - and
whether Win-2003 already has support for the above ProgID of the
"Side-by-Side regfree-helper" -> "Microsoft.Windows.ActCtx"

So, you might want to check this out first on the Server in question
(another necessity is, that the IIS works in 32Bit-mode... on the
newer IIS-versions one can switch either the Default- or the
ASP-ApplicationPool into 32Bit-mode, no matter if the system is
a 64Bit one - but maybe the machine in question has already a
"native 32Bit Server-version" installed...

Well, if the Server supports the SxS-ProgId (is able to create an
Object), and the ASP-environment runs in a 32Bit-Pool - you could
then place the vbRichClient5-COM-wrapper for SQLite e.g. in a
SubFolder of your *.asp-Scripts - "XCopy-like" (without need for
registry-writing or setups)... example of the folder-structure:

wwwroot/asp/
    TestSQlite.asp
wwwroot/asp/RC5/
        vbRichClient5.manifest
        vbRichClient5.dll
        vb_cairo_sqlite.dll
        DirectCOM.dll

Here's the download-page: http://vbRichClient.com/#/en/Downloads.htm

The TestSQLite.asp Script could contain for a short test:

<%
Response.Write "Simple SQLite-Demo: <br>"

On Error Resume Next
'try to create the SxS-Object - and provide it with the RC5-manifest-file
Dim SxS: Set SxS = CreateObject("Microsoft.Windows.ActCtx")
     SxS.Manifest = Server.MapPath("/Downloads/RC5/vbRichClient5.manifest")

'now create the "RC5-entry-point-object" first (a Constructor-ClassInstance)
Dim New_c: Set New_c = SxS.CreateObject("vbRichClient5.cConstructor")

'Ok, now we can create an SQLite-Connection-Object (deriving it from the
New_c constructor)
Dim Cnn: Set Cnn = New_c.Connection
     Cnn.CreateNewDB ":memory:" 'here we go with a Mem-DB for demonstration
     '...an existing file-db would be opened per: Cnn.OpenDB
Server.MapPath(".../your.db")

     Cnn.Execute "Create Table T1(ID Integer Primary Key, Txt Text)"

Dim Rs: Set Rs = Cnn.OpenRecordset("Select * From T1 Where 1=0") 'open
an empty Rs on T1
             Rs.AddNew: Rs("Txt") = "foo"
             Rs.AddNew: Rs("Txt") = "bar"
         Rs.UpdateBatch 'commit the two inserts into the DB


         Set Rs = Cnn.OpenRecordset("Select * From T1") 'now we select
the whole table
         Do Until Rs.EOF
            Response.Write Rs("ID") & ",  " & Rs("Txt") & "<br>"
            Rs.MoveNext
         Loop

If Err Then Response.Write Err.Description & "<br>": Err.Clear
%>

HTH

Olaf

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: how to use sqlite from classic ASP with no installation...

Olaf Schmidt-2
Am 29.06.2016 um 07:52 schrieb Olaf Schmidt:

Sorry, the line below (of the Test-Script) does not match with the
little "folder-layout" I've mentioned in my previous post -
so it needs to be adapted to the concrete (absolute or relative)
path, where the manifest (along with the 3 Binaries) will be located.

> SxS.Manifest = Server.MapPath("/Downloads/RC5/vbRichClient5.manifest")

...according to the Example-Folder-Layout (here it is again):

wwwroot/asp/
    TestSQlite.asp
wwwroot/asp/RC5/
        vbRichClient5.manifest
        vbRichClient5.dll
        vb_cairo_sqlite.dll
        DirectCOM.dll

the line above should have been:
SxS.Manifest = Server.MapPath("/asp/RC5/vbRichClient5.manifest")

Olaf

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users