VBScript error 800a01c2 when trying to open Access

Results 1 to 2 of 2

Thread: VBScript error 800a01c2 when trying to open Access

  1. #1
    jakoye Guest

    Default VBScript error 800a01c2 when trying to open Access

    Microsoft VBScript runtime error &#039 800a01c2&#039 <BR>Wrong number of arguments or invalid property assignment: &#039Open&#039 <BR>/Mob23/codeTester.asp, line 14 <BR><BR>I get this error everytime I run this code. I&#039m running PWS, Win95, VI 1.0. Here&#039s the code:<BR><BR>&#060;%@ LANGUAGE="VBSCRIPT" %&#062;<BR>&#060;HTML&#062;<BR>&#060;!--#INCLUDE FILE="DataStore.txt"--&#062;<BR><BR>&#060;%<BR><BR>Dim objConn<BR>Dim objRec<BR><BR>Set objConn = Server.CreateObject("ADODB.Connection")<BR>Set objRec = Server.CreateObject("ADODB.Connection")<BR><BR>obj Conn.Open strConnect<BR>objRec.Open "MobQuestions", objConn, 0, 1, 2<BR><BR>While Not objRec.EOF<BR> Response.Write objRec("NumCorrAnsw") & "<BR>"<BR> objRec.MoveNext<BR>Wend<BR><BR>objRec.Close<BR>obj Conn.Close<BR>Set objRec = Nothing<BR>Set objConn = Nothing<BR>%&#062;<BR><BR>This is the DataStore file:<BR>&#060;%<BR>strConnect = "Driver={Microsoft Access Driver (*.mdb)};" & _<BR>"DBQ=C:WindowsDesktopBM.mdb"<BR>%&#062;<BR><B R>I took this straight from WROX&#039s Beginning ASP so I don&#039t see why it doesn&#039t work. I don&#039t think there&#039s anything wrong with the syntax. If anybody&#039s seen this before, please post. Thank you.

  2. #2
    Stephan Zutterman Guest

    Default RE: VBScript error 800a01c2 when trying to open Ac

    Somewhere along your code I&#039m reading:<BR><BR>Set objConn = Server.CreateObject("ADODB.Connection")<BR>Set objRec = Server.CreateObject("ADODB.Connection")<BR><BR><BR >Shouldn&#039t the second line be:<BR><BR>Set objRec = Server.CreateObject("ADODB.Recordset") ???<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
  •