0 Replies - 1170 Views - Last Post: 03 October 2013 - 08:38 AM Rate Topic: -----

#1 rollinhard  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 67
  • Joined: 13-February 05

Adding Account to glmaster

Posted 03 October 2013 - 08:38 AM

I'm getting this error, which for the life of me I can't figure out what's causing it. Any help as always is appreciated.

Microsoft OLE DB Provider for ODBC Drivers error '80040e0c'

Command text was not set for the command object.

gl001/a41.asp, line 109

which is cn.execute SLQString, numa


<HTML>
<HEAD>
<script LANGUAGE="VBScript">
<!--

-->
</script>
</HEAD>
<body  bgcolor="#808080" link="#ffffff" text="#ffffff" vlink="#ffffff">
<table border="2" width="95%" cellspacing="0" cellpadding="0">
<tr>
<td colspan="6">
<center>
<br>
ADD GL ACCOUNT
</center>
</td>
</tr>
<tr>
<td>MAJOR</td>
<td>MINOR</td>
<td>SUB 1</td>
<td>SUB 2</td>
<td>ACCOUNT DESCRIPTION</td>
<td>BALANCE</td>
</tr>

<!**************** Get Add Data -- 1st HTML>
<tr>
<td align ="center"><br><FORM METHOD="POST" ACTION="a41.asp"><INPUT TYPE ="TEXT" NAME="major" size="4" maxlength="4"></td>
<td><INPUT TYPE ="TEXT" NAME="minor" size="4" maxlength="4"></td>
<td><INPUT TYPE ="TEXT" NAME="sub1" size="4" maxlength="4"></td>
<td><INPUT TYPE ="TEXT" NAME="sub2" size="4" maxlength="4"></td>
<td><INPUT TYPE ="TEXT" NAME="acctdesc" size="40" maxlength="50"></td>
<td align="right">0.00</td>
</tr>
<tr><td colspan="6"><center>

<input type="hidden" name ="token" value ="2"><p>
<input type ="submit">
</form></td></tr>


Execution begins...
<p>

<%

dim cn
dim rs
dim tokenvalue

sub pass1

%>
<p>Pass 1
<p>

<%
end sub

sub pass2
dim SQLString, rowcount

	response.write "<p>Pass 2 tokenvalue="+cstr(tokenvalue)
	set cn=Server.Createobject("ADODB.Connection")
	cn.open "gl001", "gl001", "11111"
	response.write"<p>Connection created OK"

	set rs=Server.Createobject("ADODB.Recordset")
	majorval=request.form("major")
	minorval=request.form("minor")
	sub1val=request.form("sub1")
	sub2val=request.form("sub2")


SQLString = "SELECT * FROM glmaster WHERE major = " +cstr(majorval)+" AND minor = " +cstr(minorval)+ " AND sub1 = " +cstr(sub1val)+ " AND sub2 = " +cstr(sub2val)

	 response.write "<p>Opening rs with SQL--->"+cstr(SQLString)+"<------ "
	 rs.open SQLString, "DSN=gl001;UID=gl001;PWD=11111;"
	 response.write "<P>Recordset opened OK"

	 rowcount=0
	 while NOT rs.EOF
	 	rowcount=rowcount+1
	 	rs.movenext
	 wend
	 rs.close
	 set rs = nothing

 response.write"<p>Existence for record with major, minor, sub1, sub2 = " +cstr("majorval")+ ", " +cstr("minorval")+ ", " +cstr("sub1val")+ ", " +cstr("sub2val")
		if rowcount = 0 then
		  response.write ": Found "+cstr(rowcount)+" records. Proceeding with Insert"
		  SQLString="INSERT INTO glmaster "
		  SQLString=SQLString+"(major,minor,sub1,sub2,acctdesc,balance) VALUES ("
		  SQLString=SQLString+ request.form("major") +","
	          SQLString=SQLString +chr(39)+ request.form("minor") +chr(39)+ ","
	          SQLString=SQLString +chr(39)+ request.form("sub1") +chr(39)+ ","
	          SQLString=SQLString +chr(39)+ request.form("sub2") +chr(39)+ ","
	          SQLString=SQLString +chr(39)+request.form("acctdesc") +chr(39)+ ","
	          SQLString=SQLString + " 0.0)"

                  response.write "<p>Ready for Insert with SQLString= "+cstr(SQLString)

                 cn.execute SLQString, numa

		  if numa=1 then
		    response.write " <br>Inserted OK "
		  else
		    response.write " <br>Insert failed! Number of records inserted = " +cstr(numa)
		  end if
		cn.close
		set cn = nothing
		
                response.write "<br>Termination succesful"

		else
		response.write "<br>The Account is not unique please try again No insert will be performed"
		response.write " <br>Found: " + cStr(rowCount) + " records"
		end if
 	  end sub

	  sub passerror
	       response.write "<p>INVALID TOKEN VALUE. token="+cstr(tokernvalue)
	  end sub
	  '
	  '*** top of main
	  '

	  tokenvalue=request.form("token")
	  select case tokenvalue
	  case ""
	     call pass1
	  case "2"
	    call pass2
	  case else
	     call passerror
	  end select

%>

</BODY>
</HTML>



This post has been edited by rollinhard: 03 October 2013 - 08:43 AM


Is This A Good Question/Topic? 0
  • +

Page 1 of 1