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
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users