Bonjour,

j'essai de faire une connexion à un serveur SQL2005 dans un vbs et j'ai un souci :
voici mon code et le résultat
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
On Error Resume Next
dim args
dim cnn
 
set args = wscript.arguments
IF args.count = 0 THEN
  msgbox "erreur"
end if
 
set cnn = CreateObject("ADODB.connection")
cnn.ConnectionString = "Driver={SQL Server};Server=" + args(0) + ";Database=master;Uid=" + args(1) + ";Pwd=" + args(2)
'msgbox cnn.ConnectionString
 
cnn.open
 
if err.count <> 0 then
  msgbox "Error # " & CStr(err.Number) & " " & err.Description
else
  msgbox "connection ok"
end if
 
cnn.close
set cnn = nothing
Error # 438 Cet objet ne gère pas cette propriété ou cette méthodes
donc a priori il ne comprend pas la méthode open

Merci de bien vouloir m'aider.