vb6 deployment

Hello,
I have 2 questions regarding vb6 app deployment
1) When I create a package, 2 files included in it couldn't be installed to a new computer from this package,  (Error message box)
one of them is called simpdata
and the other oledb32, forgot the extensions....


2) how do I install AccessDatabaseEngine.exe during installation? And how to
register DSN and installing the related database during installation?

Thanks

[ 本帖最後由 luckiejacky 於 2009-3-24 14:50 編輯 ]

原帖由 luckiejacky 於 2009-3-24 14:08 發表
Hello,
I have 2 questions regarding vb6 app deployment
1) When I create a package, 2 files included in it couldn't be installed to a new computer from this package,  (Error message box)
one of them is ...

Are you using ADO or DAO? If you using ADO, you can provide the connect string to the ADO connection without using ODBC. Why do you still need ODBC? And you only need MDAC (vesion depend on your ADO version) on the client PC.

[ 本帖最後由 metralfields 於 2009-3-25 15:57 編輯 ]

TOP

原帖由 metralfields 於 2009-3-25 15:57 發表

Are you using ADO or DAO? If you using ADO, you can provide the connect string to the ADO connection without using ODBC. Why do you still need ODBC? And you only need MDAC (vesion depend on your ADO  ...


I think I am using ADO, the namespace is called ADODB (and is called ActiveX Data... Object)
But I am using Access as backend, so I must use ODBC, and it is a follow-up task.
Thanks

TOP

No. You can use DSN-Less connection to connect Access database without using any ODBC. For example. Suppose your have an MDB file (test.mdb) in the directory as the exe directory.
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim strConnect As String
Dim strSQL As String
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
strConnect = strConnect & App.Path & "\test.mdb"
strSQL = "Select * from YourTable"
cn.Open strConnect
rs.Open strSQL, cn, adOpenForwardOnly, adLockReadOnly
Do While Not rs.EOF
    Debug.Print rs.Fields(0)
    rs.MoveNext
Loop
rs.Close
cn.Close
set rs = nothing
set cn = nothing

[ 本帖最後由 metralfields 於 2009-3-25 22:51 編輯 ]

TOP

原帖由 metralfields 於 2009-3-25 22:00 發表
No. You can use DSN-Less connection to connect Access database without using any ODBC. For example. Suppose your have an MDB file (test.mdb) in the directory as the exe directory.
Dim cn As New ADODB. ...


Thanks, I trust you, but I have a strange problem, when I don't install ODBC, the ADODB will be null and throw exception, if I have installed it, it is fine?

  1. Dim rec As ADODB.Recordset
  2.     Dim strSql As String
  3.     Dim i As Long

  4.     ConnectionOpen

  5.     strSql = "Select count(*) as Count From VendorLeadTime;"
  6.    
  7.     ExecSelectSQL strSql, rec

  8.     rec.MoveFirst  <<< dead here
  9.     If rec!Count > 0 Then
  10.         Set rec = Nothing
複製代碼

[ 本帖最後由 luckiejacky 於 2009-3-26 21:34 編輯 ]

TOP

原帖由 luckiejacky 於 2009-3-26 21:33 發表


Thanks, I trust you, but I have a strange problem, when I don't install ODBC, the ADODB will be null and throw exception, if I have installed it, it is fine?


Dim rec As ADODB.Recordset
    Dim str ...

ConnectionOpen seem to be a function that you use ADO connection. Can you list it out? And did you try my code? It should connect to you mdb file without installed ODBC.

[ 本帖最後由 metralfields 於 2009-3-27 00:14 編輯 ]

TOP