VB6 ODBC in automatico

martedì 27 ottobre 2009 - 11.52

sorigrafia Profilo | Junior Member

Ciao a tutti... domande veloce veloce:
Ho una funzione per la creazione di ODBC in automatico ma non mi prende l' indirizzo del mio .mdb.
I parametri Address=.... e Database=..... sembra che non li legga proprio...
Cosa sbaglio?

Const ODBC_ADD_SYS_DSN = 5
Const vbAPINull As Long = 0&

Declare Function SQLConfigDataSource Lib "ODBCCP32.DLL" _
(ByVal hwndParent As Long, ByVal fRequest As Long, _
ByVal lpszDriver As String, ByVal lpszAttributes As String) _
As Long

Sub Try_New_DataSource()

Dim Attribs As String
Attribs = "Description=ODBC AUTO FROM VB6" & Chr$(13)
Attribs = Attribs & "OemToAnsi=No" & Chr$(13)
Attribs = Attribs & "Network=DBNMP3" & Chr$(13)
Attribs = Attribs & "Address=C:\RadanJumpSub" & Chr$(13)
Attribs = Attribs & "Database=Radan Libreria.mdb"
DBEngine.RegisterDatabase "RADANJUMPSUB", "Microsoft Access Driver (*.mdb)", False, Attribs

End Sub
--

AirLainz
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5