ADO from access 97 does work you will need mdac 2.1 or above 2.5 is latest and to goto to preferences and select ms active data objects ,<br><br>The first section makes the connection , change the vars to your info and the fnc call is to run the stored proc.<br><br><br>Dim cn As New ADODB.Connection<br>Dim rs As ADODB.Recordset<br>Dim sys4 As Variant, sys5 As Variant<br><br>Public Function fncADOConnect()<br>'Use This To transfer data to SQL Box - Check tblparameters for connection information<br>'No Parameters<br>' Connect to SQL server through SQL Server OLE DB Provider.<br>'Temp Variables<br>Dim conSQL As String, strDate As String<br>Dim conDB As Database<br>Dim conRS As Recordset<br><br><br>On Error GoTo Err_Attach_SQL<br><br> Set conDB = CurrentDb()<br> <br> ' Get Paths<br> conSQL = "select * from tblParameters where fileno=1"<br> Set conRS = conDB.OpenRecordset(conSQL, DB_OPEN_SNAPSHOT)<br> <br> <br> ' Set connection properties.<br> cn.ConnectionTimeout = 25<br> 'cn.ConnectionTimeout = 600<br> cn.Provider = "sqloledb"<br> cn.Properties("Data Source"

.Value = conRS!SQLServerAddress<br> cn.Properties("Initial Catalog"

.Value = conRS!SQLDatabaseName<br> cn.Properties("User ID"

.Value = conRS!SQLLogonName<br> cn.Properties("Password"

.Value = conRS!SQLPassword<br> <br> ' Open the database.<br> cn.Open<br> <br> conRS.close<br> <br> 'Truncate Data From All User Tables The user must be a db_owner<br> 'fncExecSQL ("xp_AddRole"

<br> fncExecSQL ("xp_TruncateAll"

<br><br><br>Public Function fncExecSQL(strSQL As String)<br><br>On Error GoTo Err_Attach_SQL<br> <br> Set rs = CreateObject("ADODB.Recordset"

<br><br> ' Open recordset.<br> Set rs = cn.Execute(strSQL)<br> <br> fncExecSQL = True<br> <br>Exit_Attach_SQL:<br> Set rs = Nothing<br> Exit Function<br><br>Err_Attach_SQL:<br> fncExecSQL = False<br> MsgBox "Encountered error: " & str$(Err) & Chr(10) & Error$, , "Attach_SQL Error"<br> Resume Exit_Attach_SQL<br><br>End Function <p>Dave<br><a href=mailto:dab@completebs.com>dab@completebs.com</a><br><a href=
Bsuiness Systems</a><br>See website for more info but we can develop most things for most people.