NigelRaper
Programmer
When i execute the following code I get<br>
'<br>
Error 3251: The operation requested by the application is not supported by the provide.<br>
'<br>
When AddNew is executed.<br>
<br>
Am i using the correct methods for ADO programming as i'm new to the concept? I get something similar using the Data Environment.<br>
<br>
Thanks Nigel<br>
<br>
Dim adocmdOrderHeader As adodb.Command<br>
Dim WithEvents adorsOrderHeader As adodb.Recordset<br>
Dim db As adodb.Connection, strSQL As String<br>
Set db = New Connection <br>
Set adocmdOrderHeader = New Command<br>
Set adorsOrderHeader = New Recordset<br>
Set adorsOrderDetails = New Recordset <br>
db.CursorLocation = adUseClient<br>
<br>
db.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=\\Abc\sys1\USERS\NDR\source\Purchase Order\PurchaseOrder.mdb;"<br>
<br>
db.Open<br>
<br>
strSQL = "SELECT PONumber,OrderDate,Department,SupplierName,SuppliersAddress,DeliveryAddress,DeliveryInstructions,OrderTotal " _<br>
& "FROM tblHeader " _<br>
& "ORDER BY PONumber;" <br>
<br>
adocmdOrderHeader.ActiveConnection = db<br>
adocmdOrderHeader.CommandType = adCmdText<br>
adocmdOrderHeader.CommandText = strSQL <br>
Set adorsOrderHeader = adocmdOrderHeader.Execute<br>
With adorsOrderHeader<br>
.AddNew<br>
!SupplierName = "Nigel Was here"<br>
.UpdateBatch adAffectAll<br>
End With
'<br>
Error 3251: The operation requested by the application is not supported by the provide.<br>
'<br>
When AddNew is executed.<br>
<br>
Am i using the correct methods for ADO programming as i'm new to the concept? I get something similar using the Data Environment.<br>
<br>
Thanks Nigel<br>
<br>
Dim adocmdOrderHeader As adodb.Command<br>
Dim WithEvents adorsOrderHeader As adodb.Recordset<br>
Dim db As adodb.Connection, strSQL As String<br>
Set db = New Connection <br>
Set adocmdOrderHeader = New Command<br>
Set adorsOrderHeader = New Recordset<br>
Set adorsOrderDetails = New Recordset <br>
db.CursorLocation = adUseClient<br>
<br>
db.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=\\Abc\sys1\USERS\NDR\source\Purchase Order\PurchaseOrder.mdb;"<br>
<br>
db.Open<br>
<br>
strSQL = "SELECT PONumber,OrderDate,Department,SupplierName,SuppliersAddress,DeliveryAddress,DeliveryInstructions,OrderTotal " _<br>
& "FROM tblHeader " _<br>
& "ORDER BY PONumber;" <br>
<br>
adocmdOrderHeader.ActiveConnection = db<br>
adocmdOrderHeader.CommandType = adCmdText<br>
adocmdOrderHeader.CommandText = strSQL <br>
Set adorsOrderHeader = adocmdOrderHeader.Execute<br>
With adorsOrderHeader<br>
.AddNew<br>
!SupplierName = "Nigel Was here"<br>
.UpdateBatch adAffectAll<br>
End With