例如:
Dim DataSource As String, sql As String
Dim conn As SQLite.SQLiteConnection
DataSource = Application.StartupPath + "\StoreExecl.db"
' //连接数据库
conn = New SQLite.SQLiteConnection()
Dim connstr As SQLite.SQLiteConnectionStringBuilder = New SQLite.SQLiteConnectionStringBuilder()
connstr.DataSource = DataSource
Try
conn.ConnectionString = connstr.ToString()
conn.Open()
Me.RTxt1.Text = "系统已连接本地数据库,成功!"
catch
endtry
装个sqlite的odbc驱动,然后跟连接其他数据库一样使用ADO连接就行了。连接字符串是:Driver=SQLite3 ODBC DriverDatabase=数据库路径
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)