|
LinkExchange Member | Free Home Pages at GeoCities |
Set cn = New rdoConnectionEnd Sub
With cn.Connect = "DSN=MyDSN;UID=sa;PWD=sa"End With
.CursorDriver = rdUseNone
.EstablishConnection rdDriverNoPrompt
Set cn = New rdoConnectionEnd Sub
With cn.Connect = "DRIVER={SQL SERVER}; UID=sa; PWD=sa;" & _End With
"DATABASE=MyDB;SERVER=MySvr"
.CursorDriver = rdUseNone
.EstablishConnection rdDriverNoPrompt
@ID int,Il codice VB5 è il seguente:
@Name Char(20)
AS
INSERT INTO MyTable VALUES (@ID, @Name)
Set cn = New rdoConnectionEnd Sub
Set sp = New rdoQuery
With cn.Connect = "DSN=MyDSN;UID=sa;PWD=sa"End With
.CursorDriver = rdUseNone
.EstablishConnection rdDriverNoPrompt
With sp.SQL = "{ call sp_MyProc (?,?) }"End With
.ActiveConnection = cn
sp(0) = 10
sp(1) = "Rossi"
.Execute rdExecDirect