PDA

View Full Version : [VB 2010] - Errore accesso file access


lucausa75
20-10-2011, 00:59
Salve ragazzi,

sto cercando di aprire un database access tramite VB 2010 ma mi viene visualizzato il seguente errore:

http://i51.tinypic.com/2upv19u.png

Queste le righe di comando per connettermi; dove sta l'errore?

CnnReg = New ADODB.Connection
RstReg = New ADODB.Recordset
StrCnn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & SystemPath() & DB & ";Jet OLEDB:Database Password=databaseconpassword;Mode=ReadWrite|Share Deny None;Persist Security Info=False"
CnnReg.Open(StrCnn)
StrSql = "SELECT * FROM " & TB & " WHERE IDSeriale <> 0"
RstReg.CursorType = ADODB.CursorTypeEnum.adOpenStatic
RstReg.CursorLocation = ADODB.CursorLocationEnum.adUseClient
RstReg.Open(StrSql, CnnReg)

Grazie

lucausa75
22-10-2011, 12:06
Risolto cambiando la stringa di connessione:

da
StrCnn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & SystemPath() & DB & ";Jet OLEDB:Database Password=databaseconpassword;Mode=ReadWrite|Share Deny None;Persist Security Info=False"

a
StrCnn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & SystemPath() & DB & ";Jet OLEDB:Database Password=databaseconpassword"