When I coded in VB6, I used a wrapper called dhRichClient to talk with my database. One of the things dhRichClient allows when creating a database is something I've been unsuccessful with in dotConnect: Assigning an alias to the database.
I'm using ConnectionStringBuilder and using the example shown in the dotConnect documentation, but with my path and filename for the datasource. Essentially:
Code: Select all
Dim connSB As SQLiteConnectionStringBuilder
connSB.DataSource = "D:\TestApplication\database.db"
connSB.FailIfMissing = false
connSB.Locking = LockingMode.Exclusive
connSB.AutoVacuum = AutoVacuumMode.Full
connSB.ConnectionTimeout = 20
Dim sqLiteConnection1 As SQLiteConnection(connSB.ConnectionString)
But: Suppose I want the database to have an alias (lets say, "DBAlias" for sake of example). How would I go about this so that when I do my transactions later in the application, I can use the alias instead? In other words:
Code: Select all
SELECT [Desc] FROM [DBAlias] WHERE [InStock]=1;
Code: Select all
SELECT [Desc] FROM [database] WHERE [InStock]=1;
In case it matters, I'm using VB.net 2008 and the standard (free) version of dotConnect (3.10.121, I believe --which brings up a different question: How do I poll the wrapper to return its version?)
Thanks!