Page History
...
In the code, the differences between the two programs is highlighted. They They are:
Changing the connection name. Use PUBS instead of NWIND. Additionally, Access does not require a user name. SQL SQL Server does require a user name, which we specify as sa, the System Administrator. Your user name may be different. It almost certainly is if you're not the System Administrator. You also may need a password, which is the fourth parameter to QryInstance(). Consult your database administrator.
Changing the SQL Select statement. Since the table and columns are different, it makes sense that the SQL Select statement to be executed will change.
Changing the Combo Box Name. Control names should be easily referenced. In this example, since the combo box is populated with author names, we named it AUTHORS.
Code Block |
---|
$insert XO_Equates hXO = XOInstance('PUBS' , '', 'sa') if hXO then hQry = QryInstance(hXO) if hQry then flag = QryMethod(hQry, QRY_EXECUTE$, "select au_lname + ', ' + au_fname from authors order by au_lname") row = "" results = "" loop flag = QryMethod(hQry, QRY_GETROW$, row) while flag results<-1> = row repeat QryMethod(hQry, QRY_DESTROY$) end rv = Set_Property (@window : '.AUTHORS', 'LIST', results) XOMethod(hXO, XO_DESTROY$) end |