Results 1 to 2 of 2

Thread: Student

  1. #1
    Join Date
    Dec 1969

    Default Student

    I wrote following command lines to connect to an Access database,<BR>the web server I use is MS Personal Web Server. <BR><BR>set rs=server.createobject("adodb.Recordset")<BR>sqlst mt = "SELECT * FROM Water97"<BR>connectme="DSN=Ritchot"<BR>rs.Open sqlstmt, connectme<BR><BR>I use browser to access this file, the result is:<BR><BR>Microsoft VBScript runtime error &#039 800a01ad&#039 <BR>ActiveX component can&#039t create object<BR><BR>Anyone can help me solve this problem?

  2. #2
    icabod Guest

    Default RE: Student

    You need to create a connection object too.. (very important!)<BR><BR>Try this:<BR><BR>&#060;%<BR>&#039Create connection object<BR>Set conn = Server.CreateObject("ADODB.Connection")<BR>set rs=server.createobject("adodb.Recordset")<BR>sqlst mt = "SELECT * FROM Water97"<BR>connectme="DSN=Ritchot"<BR>&#039Open the database<BR>conn.Open connectme<BR>&#039get your recordset<BR>rs.Open sqlstmt, conn, 1, 3<BR>%&#062;<BR>--------<BR>Connections work like this:<BR><BR>- Create connection<BR>- Open database<BR>- Create Recordset<BR>- Tell recordset what you want (your SQL statement)<BR>- Tell the recordset where to get it from (conn)<BR>- Set cursor/locktype (1,3)<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts