error of reading with ADO
- From: "pfm" <marrocn@xxxxxxxxx>
- Date: 11 Jan 2007 07:27:53 -0800
I hava a database mdb protected by username ad password.
I create as administrator a temprary database .mdb without username and
password
and through a Ado connection I create a table with a query created from
the protected database.
With a new connection to the unprotectd database I want to exprot
records through a string SQL
the records but I found a message
"Impossibile leggere record. authorization of reading not available for
"TmpToExcel"
If I open the mdb file with access and create a query with the same
text it is good
thank you in advance
Marro
' 3- creazione temp.mdb
If CreateNewMDB_ADO(sPathToExcel, "Temp", 5) Then
' 4- eseguo la la query di creazione tabella TmpToExcel in
temp.mdb
Set cn = New ADODB.Connection
cn.CursorLocation = adUseClient
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & sPathDatabase & "\" &
sDatabase & ";" & _
"User ID=" & sUser & ";" & _
"Password=" & sPwd
cn.Properties("Jet OLEDB:System Database") = sPathDatabase &
"\" & sDataGroup
cn.Open
Dim sQueryCreaTabella As String
' Select campi INTO NomeNuovaTabella IN path+nomemdb FROM
qtoExcel
sQueryCreaTabella = "SELECT * INTO TmpToExcel " & " IN " & _
Chr(34) & sPathToExcel & "\Temp.mdb " &
Chr(34) & _
"FROM qToExcel"
cn.Execute sQueryCreaTabella
cn.Close
' 5- esporto i dati "from tabella creata" (TmpToExcel) in excel
Dim sSqlTabToExcel As String
Set cnTemp = New ADODB.Connection
'cnTemp.CursorLocation = adUseClient
cnTemp.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" &
_
"Data Source=" & sPathToExcel & "\" &
"Temp.mdb;"
cnTemp.Open
sSqlTabToExcel = "SELECT * INTO [Excel 8.0;Database=" & _
sPathToExcel & "\AnalisiDati.xls].[MieiDati]
FROM TmpToExcel"
cnTemp.Excecute sSqlTabToExcel
<<<<<<-------------------------------------------------------------
.
- Prev by Date: Re: Cannot read data from Access 2007 database
- Next by Date: RE: VB6.0 / ADO / Parameterized Query / SQLServer 2000 -- help...
- Previous by thread: Re: Stand Alone Recordsets
- Next by thread: RE: VB6.0 / ADO / Parameterized Query / SQLServer 2000 -- help...
- Index(es):
Relevant Pages
|
|