I've done a test following an example from MSDN. Code is below.
The difference is that Microsoft's example uses an object ADODC (data
control - not a simple recordset)
Strange thing : the column name and the table name has to have double quotes
in front and after <TEST.""Products""> otherwise I get the eror "Base table
not found" the same error I found when I used SQL Server Enterprise Manager
to export tables Nortwind to SAPDB.


Private Sub Form_Load()
   Dim ConnectionString As String

   ConnectionString = "Provider=MSDASQL.1;Password=test;" & _
   "Persist Security Info=True;User ID=test;Data Source=testSAPDB"

   ' Note that for both ADO Data controls, the Recordsource must contain
   ' one common field: the SupplierID. It is this common field that will
   ' be changed by the DataCombo control in the recordset returned by
   ' ADODC1. ADODC2 supplies the value to change to.
   With Adodc1
      .RecordSource = _
      "SELECT ""ProductName"", ""ProductID"", ""SupplierID"" FROM
TEST.""Products"""
      .ConnectionString = ConnectionString
      .Refresh
      .Caption = "Products"
      .Visible = False
   End With

   With Adodc2
      .RecordSource = "SELECT ""CompanyName"", ""SupplierID"" FROM
""Suppliers"""
      .ConnectionString = ConnectionString
      .Refresh
      .Caption = "Suppliers"
      .Visible = False
   End With

   Set DataGrid1.DataSource = Adodc1

   With DataCombo1
      Set .DataSource = Adodc1
      .DataField = "SupplierID" ' The field to be changed.
      .BoundColumn = "SupplierID"   ' Field in ADODC2 that changes
                                    ' DataField.
      Set .RowSource = Adodc2
      .ListField = "CompanyName" ' Field displayed by DataCombo.
   End With

   ' Synchronize DataGrid and DataCombo by
   ' moving to first record of ADODC1's recordset.
   Adodc1.Recordset.MoveFirst
 End Sub





-------------------------------------------------------
Xnet scaneaza automat toate mesajele impotriva virusilor folosind RAV AntiVirus.
Xnet automatically scans all messages for viruses using RAV AntiVirus.

Nota: RAV AntiVirus poate sa nu detecteze toti virusii noi sau toate variantele lor. 
Va rugam sa luati in considerare ca exista un risc de fiecare data cand deschideti 
fisiere atasate si ca MobiFon nu este responsabila pentru nici un prejudiciu cauzat de 
virusi.
Disclaimer: RAV AntiVirus may not be able to detect all new viruses and variants. 
Please be aware that there is a risk involved whenever opening e-mail attachments to 
your computer and that MobiFon is not responsible for any damages caused by viruses.

_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to