Microsoft Remote Data ServiceMicrosoft Remote Data Service*
*Contents  *Index  *Topic Contents

Add Code to Send a Query to the Database

Search for the words "Tutorial: Send a Query to the Database." Copy the following script and paste it under the comment.

<Script Language= "VBScript">
SUB Window_OnLoad
	Server.Value = "http://<%=Request.ServerVariables("SERVER_NAME")%>"
   	Connect.Value = "DSN=AdvWorks"
   	SQL.Value = "Select * from Products"
END SUB

SUB Run_OnClick
	ADC.Server = Server.Value
	ADC.Connect = Connect.Value
	ADC.SQL = SQL.Value

	ADC.Refresh
END SUB

Note When you specify the data source through the Connect property, you will usually provide a data source name, user ID, and password (for example, "DSN=SalesDB;UID=Manager;PWD=secret;"). With Microsoft Access databases, you don't need to specify a user ID (UID) or password (PWD).


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.