Salut
J'aimerais savoir si c'est possible de se connecter sur une base de donnée oracle, si oui comment fait on j'ai essayé quelque truc mais sans succès ...
Version imprimable
Salut
J'aimerais savoir si c'est possible de se connecter sur une base de donnée oracle, si oui comment fait on j'ai essayé quelque truc mais sans succès ...
salut,
:google2:
http://www.codeproject.com/vbscript/...ion_string.asp
Bonjour,
Il faudra que tu adaptes le code en fonction du pilote Oracle que tu utilises :
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 ChaineOracle = "driver={PB INTERSOLV OEM 3.11 32-BIT Oracle8};UID=NOM;PWD=PASSWORD;SERVER=NOMSERVEUR;" set toto = createobject("adodb.recordset") mySQL = "select * from LaTable" toto.open mySQL, ChaineOracle if not toto.EOF then toto.movefirst DO UNTIL toto.eof Msg = Msg & toto("NOM") & chr(10) toto.movenext LOOP end if toto.close set toto = nothing MsgBox Msg
c'est bon merci :) j'ai fait un petit mélange des deuxCode:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 Sub Button1_EventClick() Dim This : Set This = Button1 Dim strCon:strCon = "Driver={Microsoft ODBC for Oracle}; " & _ "CONNECTSTRING=(DESCRIPTION=" & _ "(ADDRESS=(PROTOCOL=TCP)" & _ "(HOST=ip)(PORT=1521))" & _ "(CONNECT_DATA=(SID=nom))); uid=log;pwd=mdp;" Dim oCon:Set oCon = createobject("adodb.connection") Dim oRs:Set oRs = createobject("adodb.recordset") oCon.Open strCon Set oRs = oCon.Execute("select * from tie where nomtie='JMBRUNEAU'") While Not oRs.EOF msgbox oRs.Fields(0).value oRs.MoveNext Wend oCon.close Set oRs = Nothing Set oCon = Nothing End Sub