Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: RE: Data Type Mismatch


Message #1 by "Matthew Lohr" <mlohr@t...> on Mon, 1 May 2000 12:20:29 -0400
Ok I see where my problem is but how do i change it.  I know I need to

somehow change where it sys text but I do not know where to change it to



<script language=vbscript>

        Sub Window_OnLoad()

                'Save the club name currently displayed, just in case the

                'user wants to update this club

                frmDisplay.txtClubName.value = _



frmDisplay.cboClubs(frmDisplay.cboClubs.selectedIndex).text

        End Sub



        Sub cboClubs_OnClick()

                'Save the team name the user selects by clicking on the

combo box

                frmDisplay.txtClubName.value = _



frmDisplay.cboClubs(frmDisplay.cboClubs.selectedIndex).text

        End Sub



        Sub cboClubs_OnChange()

                'Save the team name the user selects by scrolling the combo

box

                'with the arrow keys

                frmDisplay.txtClubName.value = _



frmDisplay.cboClubs(frmDisplay.cboClubs.selectedIndex).text

        End Sub

        </script>



-----Original Message-----

From: Matthew Lohr [mailto:mlohr@t...]

Sent: Monday, May 01, 2000 11:33 AM

To: 'ASP Databases'

Subject: Data Type Mismatch





I keep getting the following error when I am trying to update a record in an

access database.  I know the field type is set to autonumber.  I can't

figure out where in my code it is not allowing this.  If I change the field

to text it works fine.  I need it set to autonumber though.  I was trying to

change some of the code from the book in Chapter 10 to fit my database an

app.  I know the code for this in the book was set to a text filed for the

database.  How do I find out where to change it.  The error is as follows.

The code I have is posted after that.





Update Team Form





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



[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria

expression.



/lacrosse/Teams/update.asp, line 89



Message #2 by "Matthew Lohr" <mlohr@t...> on Mon, 1 May 2000 11:33:03 -0400
I keep getting the following error when I am trying to update a record in an

access database.  I know the field type is set to autonumber.  I can't

figure out where in my code it is not allowing this.  If I change the field

to text it works fine.  I need it set to autonumber though.  I was trying to

change some of the code from the book in Chapter 10 to fit my database an

app.  I know the code for this in the book was set to a text filed for the

database.  How do I find out where to change it.  The error is as follows.

The code I have is posted after that.





Update Team Form





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



[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria

expression.



/lacrosse/Teams/update.asp, line 89









<HTML>

<HEAD>



<TITLE>Reccouncil.com</TITLE>

</HEAD>

<BODY>

Update Team Form<br><br>



<%



If Len(Request.Form("FormAction")) = 0 Then



	'Create the recordset object

	Set objRS = Server.CreateObject("ADODB.Recordset")



	'Open the recordset getting a list of all teams

	objRS.Open "Select team_id, teams from teams","dsn=recequip"

%>

	<form action=update.asp method=post name=frmDisplay>

		<input type=hidden name=FormAction value=Step2>

		<input type=hidden name=txtClubName>

		<table>

			<tr>

			<td colspan=2>Select a team to update</td>

			</tr>

			<tr>

			<td>Team Name</td>

			<td><select name=cboClubs>

<%

			'Loop through the recordset adding each club to the combo box

			Do While Not objRS.EOF

%>

				<option value="<%=objRS("team_id")%>">

					<%=objRS("teams")%></option>

<%

				objRS.MoveNext

			Loop



			'Close and dereference database objects

			objRS.Close

			Set objRS = Nothing

%>

				</select></td>

			</tr>

			<tr>

			<td height=60><input type=submit name=btnSubmit value=Submit></td>

			</tr>

		</table>

	</form>



	<script language=vbscript>

	Sub Window_OnLoad()

		'Save the club name currently displayed, just in case the

		'user wants to update this club

		frmDisplay.txtClubName.value = _

			frmDisplay.cboClubs(frmDisplay.cboClubs.selectedIndex).text

	End Sub



	Sub cboClubs_OnClick()

		'Save the team name the user selects by clicking on the combo box

		frmDisplay.txtClubName.value = _

			frmDisplay.cboClubs(frmDisplay.cboClubs.selectedIndex).text

	End Sub



	Sub cboClubs_OnChange()

		'Save the team name the user selects by scrolling the combo box

		'with the arrow keys

		frmDisplay.txtClubName.value = _

			frmDisplay.cboClubs(frmDisplay.cboClubs.selectedIndex).text

	End Sub

	</script>



<%



ElseIf Request.Form("FormAction") = "Step2" Then



	'Create the recordset object

	Set objRS = Server.CreateObject("ADODB.Recordset")



	'Set the SQL string

	strSQL = "Select * from teams Where team_id = '" & _

		Request.Form("cboClubs") & "'"



	'Open the recordset getting the club details for this club

	objRS.Open strSQL,"dsn=recequip"

%>

<form action=updated.asp method=post name=frmUpdate>

	<input type=hidden name=Action value=Update>

	<input type=hidden name=txtClubCode

		value=<%=Request.Form("cboClubs")%>>

	<table>

		<tr>

		<td>Team Name</td>

		<td><font color=navy

face=fantasy><b><%=Request.Form("txtClubName")%></b></font></td>

		<td width=10></td>

		<td>Team ID</td>

		<td><font color=navy

face=fantasy><b><%=Request.Form("cboClubs")%></b></font></td>

		</tr>

		<tr>

		<td nowrap>Coach Name</td>

		<td><input type=text name=txtcoach size

				value=<%=objRS("coach")%>></td>

		<td width=10></td>

		<td>Phone No.</td>

		<td><input type=text name=txtcoachph size=14

				value=<%=objRS("coachph")%>> </td>

		</tr>

		<tr>

		<td>Contact Name</td>

		<td><input type=text name=txtcontact size

				value=<%=objRS("contact")%>></td>

		<td width=10></td>





		<td>Phone No.</td>

		<td colspan=4>

			<input type=text name=txtcontactph size=14

				value=<%=objRS("contactph")%>></td>

		</tr>





		<tr>

		<td height=60><input type=submit name=btnSubmit value=Submit></td>

		</tr>

	</table>

</form>



<%

		'Close and dereference database objects

		objRS.Close

		Set objRS = Nothing



End If	'End If for step processing

%>



</BODY>

</HTML>



Message #3 by "Ken Schaefer" <ken.s@a...> on Wed, 3 May 2000 10:20:26 +1000
Hi,



Which is line 89?!?



Anyway, looking through your code, I'd *guess* that it would be:



> strSQL = "Select * from teams Where team_id = '" & _

> Request.Form("cboClubs") & "'"



if this is the case then remove the single quote marks from around

Request.Form("cboClubs") and it should work. For numeric fields like

autonumber, you don't need single quote marks - you only need them for

text/memo fields (I'm assuming you're using Access).



Cheers

Ken



----- Original Message -----

From: "Matthew Lohr" 

To: "ASP Databases" <asp_databases@p...>

Sent: Tuesday, May 02, 2000 1:33 AM

Subject: [asp_databases] Data Type Mismatch





> I keep getting the following error when I am trying to update a record in

an

> access database.  I know the field type is set to autonumber.  I can't

> figure out where in my code it is not allowing this.  If I change the

field

> to text it works fine.  I need it set to autonumber though.  I was trying

to

> change some of the code from the book in Chapter 10 to fit my database an

> app.  I know the code for this in the book was set to a text filed for the

> database.  How do I find out where to change it.  The error is as follows.

> The code I have is posted after that.

>

>

> Update Team Form

> Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

>

> [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria

> expression.

>

> /lacrosse/Teams/update.asp, line 89



</munged>



Message #4 by "Matthew Lohr" <mlohr@t...> on Wed, 3 May 2000 13:04:30 -0400
Great thanks I did this and the error went away.  Alas a new error has risen

to do battle. Now I get that this requires a string input.  Then when I take

out the qoutes that make my team_id a string I end up with can not find name

or ordinal reference specified.  I have lost my mind.The error maessage is

as follows.





Update Team Form





Request object error 'ASP 0102 : 80004005'



Expecting string input



/lacrosse/Teams/update.asp, line 85



The function expects a string as input. Update Team Form



The first line is 85



strSQL = "Select * from teams Where team_id = '" & _

		Request.Form(cboClubs) & "'"





-----Original Message-----

From: Ken Schaefer 

Sent: Tuesday, May 02, 2000 8:20 PM

To: ASP Databases

Subject: [asp_databases] Re: Data Type Mismatch





Hi,



Which is line 89?!?



Anyway, looking through your code, I'd *guess* that it would be:



> strSQL = "Select * from teams Where team_id = '" & _

> Request.Form("cboClubs") & "'"



if this is the case then remove the single quote marks from around

Request.Form("cboClubs") and it should work. For numeric fields like

autonumber, you don't need single quote marks - you only need them for

text/memo fields (I'm assuming you're using Access).



Cheers

Ken



----- Original Message -----

From: "Matthew Lohr"

To: "ASP Databases" <asp_databases@p...>

Sent: Tuesday, May 02, 2000 1:33 AM

Subject: [asp_databases] Data Type Mismatch





> I keep getting the following error when I am trying to update a record in

an

> access database.  I know the field type is set to autonumber.  I can't

> figure out where in my code it is not allowing this.  If I change the

field

> to text it works fine.  I need it set to autonumber though.  I was trying

to

> change some of the code from the book in Chapter 10 to fit my database an

> app.  I know the code for this in the book was set to a text filed for the

> database.  How do I find out where to change it.  The error is as follows.

> The code I have is posted after that.

>

>

> Update Team Form

> Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

>

> [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria

> expression.

>

> /lacrosse/Teams/update.asp, line 89



</munged>





---

You are currently subscribed to asp_databases




Message #5 by "Morrow, Jeff" <jmorrow@u...> on Wed, 3 May 2000 13:38:26 -0500
What is the Type of data that is being entered into the field "cboClubs" if

that datatype is a string then the database won't understand it, you will

get a type mismatch.  Maybe you need to re-think your SQL statement because

it sounds as if you are querying an integer-type column with a string-type

argument



-----Original Message-----

From: Matthew Lohr 

Sent: Wednesday, May 03, 2000 12:05 PM

To: ASP Databases

Subject: [asp_databases] Re: Data Type Mismatch





Great thanks I did this and the error went away.  Alas a new error has risen

to do battle. Now I get that this requires a string input.  Then when I take

out the qoutes that make my team_id a string I end up with can not find name

or ordinal reference specified.  I have lost my mind.The error maessage is

as follows.





Update Team Form





Request object error 'ASP 0102 : 80004005'



Expecting string input



/lacrosse/Teams/update.asp, line 85



The function expects a string as input. Update Team Form



The first line is 85



strSQL = "Select * from teams Where team_id = '" & _

		Request.Form(cboClubs) & "'"





-----Original Message-----

From: Ken Schaefer 

Sent: Tuesday, May 02, 2000 8:20 PM

To: ASP Databases

Subject: [asp_databases] Re: Data Type Mismatch





Hi,



Which is line 89?!?



Anyway, looking through your code, I'd *guess* that it would be:



> strSQL = "Select * from teams Where team_id = '" & _

> Request.Form("cboClubs") & "'"



if this is the case then remove the single quote marks from around

Request.Form("cboClubs") and it should work. For numeric fields like

autonumber, you don't need single quote marks - you only need them for

text/memo fields (I'm assuming you're using Access).



Cheers

Ken



----- Original Message -----

From: "Matthew Lohr"

To: "ASP Databases" <asp_databases@p...>

Sent: Tuesday, May 02, 2000 1:33 AM

Subject: [asp_databases] Data Type Mismatch





> I keep getting the following error when I am trying to update a record in

an

> access database.  I know the field type is set to autonumber.  I can't

> figure out where in my code it is not allowing this.  If I change the

field

> to text it works fine.  I need it set to autonumber though.  I was trying

to

> change some of the code from the book in Chapter 10 to fit my database an

> app.  I know the code for this in the book was set to a text filed for the

> database.  How do I find out where to change it.  The error is as follows.

> The code I have is posted after that.

>

>

> Update Team Form

> Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

>

> [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria

> expression.

>

> /lacrosse/Teams/update.asp, line 89



</munged>



Message #6 by "Myle" <myle.pham@n...> on Wed, 3 May 2000 11:34:57 -0600
Try this



strSQL = "Select * from teams Where team_id = '"_

& Request.Form(cboClubs) & "'"

-----Original Message-----

From: Matthew Lohr 

Sent: Wednesday, May 03, 2000 11:05 AM

To: ASP Databases

Subject: [asp_databases] Re: Data Type Mismatch





Great thanks I did this and the error went away.  Alas a new error has risen

to do battle. Now I get that this requires a string input.  Then when I take

out the qoutes that make my team_id a string I end up with can not find name

or ordinal reference specified.  I have lost my mind.The error maessage is

as follows.





Update Team Form





Request object error 'ASP 0102 : 80004005'



Expecting string input



/lacrosse/Teams/update.asp, line 85



The function expects a string as input. Update Team Form



The first line is 85



strSQL = "Select * from teams Where team_id = '" & _

		Request.Form(cboClubs) & "'"





-----Original Message-----

From: Ken Schaefer

Sent: Tuesday, May 02, 2000 8:20 PM

To: ASP Databases

Subject: [asp_databases] Re: Data Type Mismatch





Hi,



Which is line 89?!?



Anyway, looking through your code, I'd *guess* that it would be:



> strSQL = "Select * from teams Where team_id = '" & _

> Request.Form("cboClubs") & "'"



if this is the case then remove the single quote marks from around

Request.Form("cboClubs") and it should work. For numeric fields like

autonumber, you don't need single quote marks - you only need them for

text/memo fields (I'm assuming you're using Access).



Cheers

Ken



----- Original Message -----

From: "Matthew Lohr"

To: "ASP Databases" <asp_databases@p...>

Sent: Tuesday, May 02, 2000 1:33 AM

Subject: [asp_databases] Data Type Mismatch





> I keep getting the following error when I am trying to update a record in

an

> access database.  I know the field type is set to autonumber.  I can't

> figure out where in my code it is not allowing this.  If I change the

field

> to text it works fine.  I need it set to autonumber though.  I was trying

to

> change some of the code from the book in Chapter 10 to fit my database an

> app.  I know the code for this in the book was set to a text filed for the

> database.  How do I find out where to change it.  The error is as follows.

> The code I have is posted after that.

>

>

> Update Team Form

> Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

>

> [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria

> expression.

>

> /lacrosse/Teams/update.asp, line 89



</munged>





---

You are currently subscribed to asp_databases






---

You are currently subscribed to asp_databases






Message #7 by =?iso-8859-1?Q?Gabriel_Hern=E1ndez?= <gabriel@c...> on Wed, 3 May 2000 15:00:54 -0400

strSQL = "Select * from teams Where team_id = '<%=Request.Form(cboClubs)%>'"



----- Original Message -----

From: Matthew Lohr <mlohr@t...>

To: ASP Databases <asp_databases@p...>

Sent: Wednesday, May 03, 2000 1:04 PM

Subject: [asp_databases] Re: Data Type Mismatch





> Great thanks I did this and the error went away.  Alas a new error has

risen

> to do battle. Now I get that this requires a string input.  Then when I

take

> out the qoutes that make my team_id a string I end up with can not find

name

> or ordinal reference specified.  I have lost my mind.The error maessage is

> as follows.

>

>

> Update Team Form

>

>

> Request object error 'ASP 0102 : 80004005'

>

> Expecting string input

>

> /lacrosse/Teams/update.asp, line 85

>

> The function expects a string as input. Update Team Form

>

> The first line is 85

>

> strSQL = "Select * from teams Where team_id = '" & _

> Request.Form(cboClubs) & "'"

>

>

> -----Original Message-----

> From: Ken Schaefer

> Sent: Tuesday, May 02, 2000 8:20 PM

> To: ASP Databases

> Subject: [asp_databases] Re: Data Type Mismatch

>

>

> Hi,

>

> Which is line 89?!?

>

> Anyway, looking through your code, I'd *guess* that it would be:

>

> > strSQL = "Select * from teams Where team_id = '" & _

> > Request.Form("cboClubs") & "'"

>

> if this is the case then remove the single quote marks from around

> Request.Form("cboClubs") and it should work. For numeric fields like

> autonumber, you don't need single quote marks - you only need them for

> text/memo fields (I'm assuming you're using Access).

>

> Cheers

> Ken

>

> ----- Original Message -----

> From: "Matthew Lohr"

> To: "ASP Databases" <asp_databases@p...>

> Sent: Tuesday, May 02, 2000 1:33 AM

> Subject: [asp_databases] Data Type Mismatch

>

>

> > I keep getting the following error when I am trying to update a record

in

> an

> > access database.  I know the field type is set to autonumber.  I can't

> > figure out where in my code it is not allowing this.  If I change the

> field

> > to text it works fine.  I need it set to autonumber though.  I was

trying

> to

> > change some of the code from the book in Chapter 10 to fit my database

an

> > app.  I know the code for this in the book was set to a text filed for

the

> > database.  How do I find out where to change it.  The error is as

follows.

> > The code I have is posted after that.

> >

> >

> > Update Team Form

> > Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

> >

> > [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria

> > expression.

> >

> > /lacrosse/Teams/update.asp, line 89

>

> </munged>

>

>

> ---

> You are currently subscribed to asp_databases


$subst('Email.Unsub')

>

>

> ---

> You are currently subscribed to asp_databases


$subst('Email.Unsub')

>



Message #8 by "Ken Schaefer" <ken.s@a...> on Thu, 4 May 2000 15:21:57 +1000
Is this line within a function? If so, can you give the whole function, and

also show the lines where the function is being called from?



Also, when debugging SQL statements, do the following:



strSQL = "....whatever your string is"

Response.Write strSQL



and then look at what is actually being passed to the database. From the

error you are getting I expect that Request.Form(cboClubs) is NULL (ie = "")

and so something is screwing up. If you Response.Write strSQL you'll be able

to see if there is anything there...



Cheers

Ken



----- Original Message -----

From: "Matthew Lohr" 

To: "ASP Databases" <asp_databases@p...>

Sent: Thursday, May 04, 2000 3:04 AM

Subject: [asp_databases] Re: Data Type Mismatch





> Great thanks I did this and the error went away.  Alas a new error has

risen

> to do battle. Now I get that this requires a string input.  Then when I

take

> out the qoutes that make my team_id a string I end up with can not find

name

> or ordinal reference specified.  I have lost my mind.The error maessage is

> as follows.

>

>

> Update Team Form

>

>

> Request object error 'ASP 0102 : 80004005'

>

> Expecting string input

>

> /lacrosse/Teams/update.asp, line 85

>

> The function expects a string as input. Update Team Form

>

> The first line is 85

>

> strSQL = "Select * from teams Where team_id = '" & _

> Request.Form(cboClubs) & "'"

>

>





Message #9 by "Ken Schaefer" <ken.s@a...> on Thu, 4 May 2000 22:30:59 +1000

>

> strSQL = "Select * from teams Where team_id 

'<%=Request.Form(cboClubs)%>'"



I might not know everything, far from it, but I can almost guarentee the

above definately wont work...



Cheers

Ken



> ----- Original Message -----

> From: Matthew Lohr 

> To: ASP Databases <asp_databases@p...>

> Sent: Wednesday, May 03, 2000 1:04 PM

> Subject: [asp_databases] Re: Data Type Mismatch

>

>

> > Great thanks I did this and the error went away.  Alas a new error has

> risen

> > to do battle. Now I get that this requires a string input.  Then when I

> take

> > out the qoutes that make my team_id a string I end up with can not find

> name

> > or ordinal reference specified.  I have lost my mind.The error maessage

is

> > as follows.





Message #10 by "Matthew Lohr" <mlohr@t...> on Thu, 4 May 2000 10:06:29 -0400
Maybe I really am misunderstanding what  is going on.  That line I thought

is supposed to be saying that strSQL is equal to this value in my database.

Now as I am typing I am understanding a little more.  If I change the

database field to a a type of text the whole thing works.  The value is not

null because at this point I am trying to update a field that is created

automatically when I do my entry form.  The only difference in this field

and the others is that it is numeric and the others are text.  I do have one

other field in this database that is always a number but it is set to text.

That is because I have that field being set by a numeric in another table.

To me it seems like it needs all the values to be of the same type.  Should

I try doing to different select statements?  And Ken your almost guarantee

that you sent after I began typing this message almost worked.  I am not

being cynical towards you guys.  I appreciate all the great help.  I am just

ready to give up.  The entire code for this follows





<HTML>

<HEAD>



<TITLE>Reccouncil.com</TITLE>

</HEAD>

<BODY>

Update Team Form<br><br>



<%

'***********************************************************

'* Step 1: Display a list of club names to select from

'***********************************************************

If Len(Request.Form("FormAction")) = 0 Then



	'Create the recordset object

	Set objRS = Server.CreateObject("ADODB.Recordset")



	'Open the recordset getting a list of all clubs

	objRS.Open "Select team_id, teams from teams","dsn=recequip"

%>

	<form action=update.asp method=post name=frmDisplay>

		<input type=hidden name=FormAction value=Step2>

		<input type=hidden name=txtClubName>

		<table>

			<tr>

			<td colspan=2>Select a team to update</td>

			</tr>

			<tr>

			<td>Team Name</td>

			<td><select name=cboClubs>

<%

			'Loop through the recordset adding each club to the combo box

			Do While Not objRS.EOF

%>

				<option value="<%=objRS("team_id")%>">

					<%=objRS("teams")%></option>

<%

				objRS.MoveNext

			Loop



			'Close and dereference database objects

			objRS.Close

			Set objRS = Nothing

%>

				</select></td>

			</tr>

			<tr>

			<td height=60><input type=submit name=btnSubmit value=Submit></td>

			</tr>

		</table>

	</form>



	<script language=vbscript>

	Sub Window_OnLoad()

		'Save the club name currently displayed, just in case the

		'user wants to update this club

		frmDisplay.txtClubName.value = _

			frmDisplay.cboClubs(frmDisplay.cboClubs.selectedIndex).text

	End Sub



	Sub cboClubs_OnClick()

		'Save the club name the user selects by clicking on the combo box

		frmDisplay.txtClubName.value = _

			frmDisplay.cboClubs(frmDisplay.cboClubs.selectedIndex)

	End Sub



	Sub cboClubs_OnChange()

		'Save the club name the user selects by scrolling the combo box

		'with the arrow keys

		frmDisplay.txtClubName.value = _

			frmDisplay.cboClubs(frmDisplay.cboClubs.selectedIndex)

	End Sub

	</script>



<%

'***********************************************************

'* Step 2: Display the form for editing a club

'***********************************************************

ElseIf Request.Form("FormAction") = "Step2" Then



	'Create the recordset object

	Set objRS = Server.CreateObject("ADODB.Recordset")



	'Set the SQL string





strSQL = "Select * from teams Where team_id 

'<%=Request.Form(cboClubs)%>'"

	'Open the recordset getting the club details for this club

	objRS.Open strSQL,"dsn=recequip"

%>

<form action=updated.asp method=post name=frmUpdate>

	<input type=hidden name=Action value=Update>

	<input type=hidden name=txtClubCode

		value=<%=Request.Form(cboClubs)%>>

	<table>

		<tr>

		<td>Team Name</td>

		<td><font color=navy

face=fantasy><b><%=Request.Form("txtClubName")%></b></font></td>

		<td width=10></td>

		<td>Team ID</td>

		<td><font color=navy

face=fantasy><b><%=Request.Form(cboClubs)%></b></font></td>

		</tr>

		<tr>

		<td nowrap>Coach Name</td>

		<td><input type=text name=txtcoach size

				value=<%=objRS("coach")%>></td>

		<td width=10></td>

		<td>Phone No.</td>

		<td><input type=text name=txtcoachph size=14

				value=<%=objRS("coachph")%>> </td>

		</tr>

		<tr>

		<td>Contact Name</td>

		<td><input type=text name=txtcontact size

				value=<%=objRS("contact")%>></td>

		<td width=10></td>





		<td>Phone No.</td>

		<td colspan=4>

			<input type=text name=txtcontactph size=14

				value=<%=objRS("contactph")%>></td>

		</tr>





		<tr>

		<td height=60><input type=submit name=btnSubmit value=Submit></td>

		</tr>

	</table>

</form>



<%

		'Close and dereference database objects

		objRS.Close

		Set objRS = Nothing



End If	'End If for step processing

%>



</BODY>

</HTML>





-----Original Message-----

From: Ken Schaefer [mailto:ken.s@a...]

Sent: Thursday, May 04, 2000 1:22 AM

To: ASP Databases

Subject: [asp_databases] Re: Data Type Mismatch





Is this line within a function? If so, can you give the whole function, and

also show the lines where the function is being called from?



Also, when debugging SQL statements, do the following:



strSQL = "....whatever your string is"

Response.Write strSQL



and then look at what is actually being passed to the database. From the

error you are getting I expect that Request.Form(cboClubs) is NULL (ie = "")

and so something is screwing up. If you Response.Write strSQL you'll be able

to see if there is anything there...



Cheers

Ken



----- Original Message -----

From: "Matthew Lohr"

To: "ASP Databases" <asp_databases@p...>

Sent: Thursday, May 04, 2000 3:04 AM

Subject: [asp_databases] Re: Data Type Mismatch





> Great thanks I did this and the error went away.  Alas a new error has

risen

> to do battle. Now I get that this requires a string input.  Then when I

take

> out the qoutes that make my team_id a string I end up with can not find

name

> or ordinal reference specified.  I have lost my mind.The error maessage is

> as follows.

>

>

> Update Team Form

>

>

> Request object error 'ASP 0102 : 80004005'

>

> Expecting string input

>

> /lacrosse/Teams/update.asp, line 85

>

> The function expects a string as input. Update Team Form

>

> The first line is 85

>

> strSQL = "Select * from teams Where team_id = '" & _

> Request.Form(cboClubs) & "'"

>

>







---

You are currently subscribed to asp_databases




Message #11 by =?iso-8859-1?Q?=C1rni_B=2E_Halld=F3rsson?= <abh@t...> on Thu, 4 May 2000 14:55:31 -0000
strSQL =3D "Select * from teams Where team_id =3D ' & 

Request("cboClubs") & "'"



This should work.



*------------------*

* Arni Halldorsson *

* abh@t...   *

*------------------*





-----Original Message-----

From: Matthew Lohr [mailto:mlohr@t...]

Sent: 4. ma=ED 2000 14:06

To: ASP Databases

Subject: [asp_databases] Re: Data Type Mismatch





Maybe I really am misunderstanding what  is going on.  That line I 

thought

is supposed to be saying that strSQL is equal to this value in my 

database.

Now as I am typing I am understanding a little more.  If I change the

database field to a a type of text the whole thing works.  The value is 

not

null because at this point I am trying to update a field that is 

created

automatically when I do my entry form.  The only difference in this 

field

and the others is that it is numeric and the others are text.  I do 

have one

other field in this database that is always a number but it is set to 

text.

That is because I have that field being set by a numeric in another 

table.

To me it seems like it needs all the values to be of the same type.  

Should

I try doing to different select statements?  And Ken your almost 

guarantee

that you sent after I began typing this message almost worked.  I am 

not

being cynical towards you guys.  I appreciate all the great help.  I am 

just

ready to give up.  The entire code for this follows





<HTML>

<HEAD>



<TITLE>Reccouncil.com</TITLE>

</HEAD>

<BODY>

Update Team Form<br><br>



<%

'***********************************************************

'* Step 1: Display a list of club names to select from

'***********************************************************

If Len(Request.Form("FormAction")) =3D 0 Then



	'Create the recordset object

	Set objRS =3D Server.CreateObject("ADODB.Recordset")



	'Open the recordset getting a list of all clubs

	objRS.Open "Select team_id, teams from teams","dsn=3Drecequip"

%>

	<form action=3Dupdate.asp method=3Dpost name=3DfrmDisplay>

		<input type=3Dhidden name=3DFormAction value=3DStep2>

		<input type=3Dhidden name=3DtxtClubName>

		<table>

			<tr>

			<td colspan=3D2>Select a team to update</td>

			</tr>

			<tr>

			<td>Team Name</td>

			<td><select name=3DcboClubs>

<%

			'Loop through the recordset adding each club to the

combo box

			Do While Not objRS.EOF

%>

				<option value=3D"<%=3DobjRS("team_id")%>">

					<%=3DobjRS("teams")%></option>

<%

				objRS.MoveNext

			Loop



			'Close and dereference database objects

			objRS.Close

			Set objRS =3D Nothing

%>

				</select></td>

			</tr>

			<tr>

			<td height=3D60><input type=3Dsubmit name=3DbtnSubmit

value=3DSubmit></td>

			</tr>

		</table>

	</form>



	<script language=3Dvbscript>

	Sub Window_OnLoad()

		'Save the club name currently displayed, just in case the

		'user wants to update this club

		frmDisplay.txtClubName.value =3D _

=09

frmDisplay.cboClubs(frmDisplay.cboClubs.selectedIndex).text

	End Sub



	Sub cboClubs_OnClick()

		'Save the club name the user selects by clicking on the

combo box

		frmDisplay.txtClubName.value =3D _

=09

frmDisplay.cboClubs(frmDisplay.cboClubs.selectedIndex)

	End Sub



	Sub cboClubs_OnChange()

		'Save the club name the user selects by scrolling the combo

box

		'with the arrow keys

		frmDisplay.txtClubName.value =3D _

=09

frmDisplay.cboClubs(frmDisplay.cboClubs.selectedIndex)

	End Sub

	</script>



<%

'***********************************************************

'* Step 2: Display the form for editing a club

'***********************************************************

ElseIf Request.Form("FormAction") =3D "Step2" Then



	'Create the recordset object

	Set objRS =3D Server.CreateObject("ADODB.Recordset")



	'Set the SQL string





strSQL =3D "Select * from teams Where team_id =3D

'<%=3DRequest.Form(cboClubs)%>'"

	'Open the recordset getting the club details for this club

	objRS.Open strSQL,"dsn=3Drecequip"

%>

<form action=3Dupdated.asp method=3Dpost name=3DfrmUpdate>

	<input type=3Dhidden name=3DAction value=3DUpdate>

	<input type=3Dhidden name=3DtxtClubCode

		value=3D<%=3DRequest.Form(cboClubs)%>>

	<table>

		<tr>

		<td>Team Name</td>

		<td><font color=3Dnavy

face=3Dfantasy><b><%=3DRequest.Form("txtClubName")%></b></font></td>

		<td width=3D10></td>

		<td>Team ID</td>

		<td><font color=3Dnavy

face=3Dfantasy><b><%=3DRequest.Form(cboClubs)%></b></font></td>

		</tr>

		<tr>

		<td nowrap>Coach Name</td>

		<td><input type=3Dtext name=3Dtxtcoach size=3D20

				value=3D<%=3DobjRS("coach")%>></td>

		<td width=3D10></td>

		<td>Phone No.</td>

		<td><input type=3Dtext name=3Dtxtcoachph size=3D14

				value=3D<%=3DobjRS("coachph")%>> </td>

		</tr>

		<tr>

		<td>Contact Name</td>

		<td><input type=3Dtext name=3Dtxtcontact size=3D20

				value=3D<%=3DobjRS("contact")%>></td>

		<td width=3D10></td>





		<td>Phone No.</td>

		<td colspan=3D4>

			<input type=3Dtext name=3Dtxtcontactph size=3D14

				value=3D<%=3DobjRS("contactph")%>></td>

		</tr>





		<tr>

		<td height=3D60><input type=3Dsubmit name=3DbtnSubmit

value=3DSubmit></td>

		</tr>

	</table>

</form>



<%

		'Close and dereference database objects

		objRS.Close

		Set objRS =3D Nothing



End If	'End If for step processing

%>



</BODY>

</HTML>





-----Original Message-----

From: Ken Schaefer [mailto:ken.s@a...]

Sent: Thursday, May 04, 2000 1:22 AM

To: ASP Databases

Subject: [asp_databases] Re: Data Type Mismatch





Is this line within a function? If so, can you give the whole function, 

and

also show the lines where the function is being called from?



Also, when debugging SQL statements, do the following:



strSQL =3D "....whatever your string is"

Response.Write strSQL



and then look at what is actually being passed to the database. From 

the

error you are getting I expect that Request.Form(cboClubs) is NULL (ie 

=3D "")

and so something is screwing up. If you Response.Write strSQL you'll be 

able

to see if there is anything there...



Cheers

Ken



----- Original Message -----

From: "Matthew Lohr"

To: "ASP Databases" <asp_databases@p...>

Sent: Thursday, May 04, 2000 3:04 AM

Subject: [asp_databases] Re: Data Type Mismatch





> Great thanks I did this and the error went away.  Alas a new error 

has

risen

> to do battle. Now I get that this requires a string input.  Then when 

I

take

> out the qoutes that make my team_id a string I end up with can not 

find

name

> or ordinal reference specified.  I have lost my mind.The error 

maessage is

> as follows.

>

>

> Update Team Form

>

>

> Request object error 'ASP 0102 : 80004005'

>

> Expecting string input

>

> /lacrosse/Teams/update.asp, line 85

>

> The function expects a string as input. Update Team Form

>

> The first line is 85

>

> strSQL =3D "Select * from teams Where team_id =3D '" & _

> Request.Form(cboClubs) & "'"

>

>







---

You are currently subscribed to asp_databases


$subst('Email.Unsub')





---

You are currently subscribed to asp_databases


$subst('Email.Unsub')

Message #12 by "Matthew Lohr" <mlohr@t...> on Thu, 4 May 2000 11:21:40 -0400
Microsoft VBScript compilation error '800a0401'

Expected end of statement

/lacrosse/Teams/update.asp, line 87

strSQL = "Select * from teams Where team_id = ' & Request("cboClubs") &' "

----------------------------------------------------------------------------

--------------^





 -----Original Message-----

From: 	Árni B. Halldórsson [mailto:abh@t...]

Sent:	Thursday, May 04, 2000 10:56 AM

To:	ASP Databases

Subject:	[asp_databases] Re: Data Type Mismatch



strSQL = "Select * from teams Where team_id = ' & Request("cboClubs") & "'"



This should work.



*------------------*

* Arni Halldorsson *

* abh@t...   *

*------------------*





-----Original Message-----

From: Matthew Lohr [mailto:mlohr@t...]

Sent: 4. maí 2000 14:06

To: ASP Databases

Subject: [asp_databases] Re: Data Type Mismatch





Maybe I really am misunderstanding what  is going on.  That line I thought

is supposed to be saying that strSQL is equal to this value in my database.

Now as I am typing I am understanding a little more.  If I change the

database field to a a type of text the whole thing works.  The value is not

null because at this point I am trying to update a field that is created

automatically when I do my entry form.  The only difference in this field

and the others is that it is numeric and the others are text.  I do have one

other field in this database that is always a number but it is set to text.

That is because I have that field being set by a numeric in another table.

To me it seems like it needs all the values to be of the same type.  Should

I try doing to different select statements?  And Ken your almost guarantee

that you sent after I began typing this message almost worked.  I am not

being cynical towards you guys.  I appreciate all the great help.  I am just

ready to give up.  The entire code for this follows





<HTML>

<HEAD>



<TITLE>Reccouncil.com</TITLE>

</HEAD>

<BODY>

Update Team Form<br><br>



<%

'***********************************************************

'* Step 1: Display a list of club names to select from

'***********************************************************

If Len(Request.Form("FormAction")) = 0 Then



	'Create the recordset object

	Set objRS = Server.CreateObject("ADODB.Recordset")



	'Open the recordset getting a list of all clubs

	objRS.Open "Select team_id, teams from teams","dsn=recequip"

%>

	<form action=update.asp method=post name=frmDisplay>

		<input type=hidden name=FormAction value=Step2>

		<input type=hidden name=txtClubName>

		<table>

			<tr>

			<td colspan=2>Select a team to update</td>

			</tr>

			<tr>

			<td>Team Name</td>

			<td><select name=cboClubs>

<%

			'Loop through the recordset adding each club to the

combo box

			Do While Not objRS.EOF

%>

				<option value="<%=objRS("team_id")%>">

					<%=objRS("teams")%></option>

<%

				objRS.MoveNext

			Loop



			'Close and dereference database objects

			objRS.Close

			Set objRS = Nothing

%>

				</select></td>

			</tr>

			<tr>

			<td height=60><input type=submit name=btnSubmit

value=Submit></td>

			</tr>

		</table>

	</form>



	<script language=vbscript>

	Sub Window_OnLoad()

		'Save the club name currently displayed, just in case the

		'user wants to update this club

		frmDisplay.txtClubName.value = _



frmDisplay.cboClubs(frmDisplay.cboClubs.selectedIndex).text

	End Sub



	Sub cboClubs_OnClick()

		'Save the club name the user selects by clicking on the

combo box

		frmDisplay.txtClubName.value = _



frmDisplay.cboClubs(frmDisplay.cboClubs.selectedIndex)

	End Sub



	Sub cboClubs_OnChange()

		'Save the club name the user selects by scrolling the combo

box

		'with the arrow keys

		frmDisplay.txtClubName.value = _



frmDisplay.cboClubs(frmDisplay.cboClubs.selectedIndex)

	End Sub

	</script>



<%

'***********************************************************

'* Step 2: Display the form for editing a club

'***********************************************************

ElseIf Request.Form("FormAction") = "Step2" Then



	'Create the recordset object

	Set objRS = Server.CreateObject("ADODB.Recordset")



	'Set the SQL string





strSQL = "Select * from teams Where team_id 

'<%=Request.Form(cboClubs)%>'"

	'Open the recordset getting the club details for this club

	objRS.Open strSQL,"dsn=recequip"

%>

<form action=updated.asp method=post name=frmUpdate>

	<input type=hidden name=Action value=Update>

	<input type=hidden name=txtClubCode

		value=<%=Request.Form(cboClubs)%>>

	<table>

		<tr>

		<td>Team Name</td>

		<td><font color=navy

face=fantasy><b><%=Request.Form("txtClubName")%></b></font></td>

		<td width=10></td>

		<td>Team ID</td>

		<td><font color=navy

face=fantasy><b><%=Request.Form(cboClubs)%></b></font></td>

		</tr>

		<tr>

		<td nowrap>Coach Name</td>

		<td><input type=text name=txtcoach size

				value=<%=objRS("coach")%>></td>

		<td width=10></td>

		<td>Phone No.</td>

		<td><input type=text name=txtcoachph size=14

				value=<%=objRS("coachph")%>> </td>

		</tr>

		<tr>

		<td>Contact Name</td>

		<td><input type=text name=txtcontact size

				value=<%=objRS("contact")%>></td>

		<td width=10></td>





		<td>Phone No.</td>

		<td colspan=4>

			<input type=text name=txtcontactph size=14

				value=<%=objRS("contactph")%>></td>

		</tr>





		<tr>

		<td height=60><input type=submit name=btnSubmit

value=Submit></td>

		</tr>

	</table>

</form>



<%

		'Close and dereference database objects

		objRS.Close

		Set objRS = Nothing



End If	'End If for step processing

%>



</BODY>

</HTML>





-----Original Message-----

From: Ken Schaefer [mailto:ken.s@a...]

Sent: Thursday, May 04, 2000 1:22 AM

To: ASP Databases

Subject: [asp_databases] Re: Data Type Mismatch





Is this line within a function? If so, can you give the whole function, and

also show the lines where the function is being called from?



Also, when debugging SQL statements, do the following:



strSQL = "....whatever your string is"

Response.Write strSQL



and then look at what is actually being passed to the database. From the

error you are getting I expect that Request.Form(cboClubs) is NULL (ie = "")

and so something is screwing up. If you Response.Write strSQL you'll be able

to see if there is anything there...



Cheers

Ken



----- Original Message -----

From: "Matthew Lohr"

To: "ASP Databases" <asp_databases@p...>

Sent: Thursday, May 04, 2000 3:04 AM

Subject: [asp_databases] Re: Data Type Mismatch





> Great thanks I did this and the error went away.  Alas a new error has

risen

> to do battle. Now I get that this requires a string input.  Then when I

take

> out the qoutes that make my team_id a string I end up with can not find

name

> or ordinal reference specified.  I have lost my mind.The error maessage is

> as follows.

>

>

> Update Team Form

>

>

> Request object error 'ASP 0102 : 80004005'

>

> Expecting string input

>

> /lacrosse/Teams/update.asp, line 85

>

> The function expects a string as input. Update Team Form

>

> The first line is 85

>

> strSQL = "Select * from teams Where team_id = '" & _

> Request.Form(cboClubs) & "'"

>

>







---

You are currently subscribed to asp_databases






---

You are currently subscribed to asp_databases




---

You are currently subscribed to asp_databases




Message #13 by "Ken Schaefer" <ken.s@a...> on Fri, 5 May 2000 10:58:20 +1000

----- Original Message -----

From: "Árni B. Halldórsson" <abh@t...>

To: "ASP Databases" <asp_databases@p...>

Sent: Friday, May 05, 2000 12:55 AM

Subject: [asp_databases] Re: Data Type Mismatch





> strSQL = "Select * from teams Where team_id = ' & Request("cboClubs") &

"'"

>

> This should work.



No, it wont...you'll just generate a compilation, expected end of statement

error...

(there's a " missing)



Cheers

Ken







Message #14 by "Ken Schaefer" <ken.s@a...> on Fri, 5 May 2000 11:00:53 +1000



> Microsoft VBScript compilation error '800a0401'

> Expected end of statement

> /lacrosse/Teams/update.asp, line 87

> strSQL = "Select * from teams Where team_id = ' & Request("cboClubs") &' "

> --------------------------------------------------------------------------

--

> --------------^



This is because there is a " missing in the statement...



strSQL = "SELECT * FROM teams "

strSQL = strSQL & "WHERE team_id = " & Request.Form("cboClubs")



will work if the field is numeric. If the field is text, then you need to

use ' around your fieldvalue eg:



strSQL = "SELECT * FROM teams "

strSQL = strSQL & "WHERE team_id = '" & Request.Form("cboClubs") & "'"



HTH



Cheers

Ken



>

>  -----Original Message-----

> From: Árni B. Halldórsson [mailto:abh@t...]

> Sent: Thursday, May 04, 2000 10:56 AM

> To: ASP Databases

> Subject: [asp_databases] Re: Data Type Mismatch

>

> strSQL = "Select * from teams Where team_id = ' & Request("cboClubs") &

"'"

>

> This should work.

>

> *------------------*

> * Arni Halldorsson *

> * abh@t...   *

> *------------------*





Message #15 by =?iso-8859-1?Q?=C1rni_B=2E_Halld=F3rsson?= <abh@t...> on Fri, 5 May 2000 13:45:23 -0000
I'm sorry, it should be like this:

strSQL =3D "Select * teams where team_id =3D '" & Request("cboClubs") & 

"'"





Arni Halldorsson

abh@t...



-----Original Message-----

From: Matthew Lohr

To: ASP Databases

Sent: 4.5.2000 15:21

Subject: [asp_databases] Re: Data Type Mismatch



Microsoft VBScript compilation error '800a0401'

Expected end of statement

/lacrosse/Teams/update.asp, line 87

strSQL =3D "Select * from teams Where team_id =3D ' & 

Request("cboClubs") &'

"

------------------------------------------------------------------------



----

--------------^





 -----Original Message-----

From: 	=C1rni B. Halld=F3rsson [mailto:abh@t...]

Sent:	Thursday, May 04, 2000 10:56 AM

To:	ASP Databases

Subject:	[asp_databases] Re: Data Type Mismatch



strSQL =3D "Select * from teams Where team_id =3D ' & 

Request("cboClubs") &

"'"



This should work.



*------------------*

* Arni Halldorsson *

* abh@t...   *

*------------------*





-----Original Message-----

From: Matthew Lohr [mailto:mlohr@t...]

Sent: 4. ma=ED 2000 14:06

To: ASP Databases

Subject: [asp_databases] Re: Data Type Mismatch





Maybe I really am misunderstanding what  is going on.  That line I

thought

is supposed to be saying that strSQL is equal to this value in my

database.

Now as I am typing I am understanding a little more.  If I change the

database field to a a type of text the whole thing works.  The value is

not

null because at this point I am trying to update a field that is 

created

automatically when I do my entry form.  The only difference in this

field

and the others is that it is numeric and the others are text.  I do 

have

one

other field in this database that is always a number but it is set to

text.

That is because I have that field being set by a numeric in another

table.

To me it seems like it needs all the values to be of the same type.

Should

I try doing to different select statements?  And Ken your almost

guarantee

that you sent after I began typing this message almost worked.  I am 

not

being cynical towards you guys.  I appreciate all the great help.  I am

just

ready to give up.  The entire code for this follows





<HTML>

<HEAD>



<TITLE>Reccouncil.com</TITLE>

</HEAD>

<BODY>

Update Team Form<br><br>



<%

'***********************************************************

'* Step 1: Display a list of club names to select from

'***********************************************************

If Len(Request.Form("FormAction")) =3D 0 Then



	'Create the recordset object

	Set objRS =3D Server.CreateObject("ADODB.Recordset")



	'Open the recordset getting a list of all clubs

	objRS.Open "Select team_id, teams from teams","dsn=3Drecequip"

%>

	<form action=3Dupdate.asp method=3Dpost name=3DfrmDisplay>

		<input type=3Dhidden name=3DFormAction value=3DStep2>

		<input type=3Dhidden name=3DtxtClubName>

		<table>

			<tr>

			<td colspan=3D2>Select a team to update</td>

			</tr>

			<tr>

			<td>Team Name</td>

			<td><select name=3DcboClubs>

<%

			'Loop through the recordset adding each club to

the

combo box

			Do While Not objRS.EOF

%>

				<option value=3D"<%=3DobjRS("team_id")%>">

					<%=3DobjRS("teams")%></option>

<%

				objRS.MoveNext

			Loop



			'Close and dereference database objects

			objRS.Close

			Set objRS =3D Nothing

%>

				</select></td>

			</tr>

			<tr>

			<td height=3D60><input type=3Dsubmit name=3DbtnSubmit

value=3DSubmit></td>

			</tr>

		</table>

	</form>



	<script language=3Dvbscript>

	Sub Window_OnLoad()

		'Save the club name currently displayed, just in case

the

		'user wants to update this club

		frmDisplay.txtClubName.value =3D _



frmDisplay.cboClubs(frmDisplay.cboClubs.selectedIndex).text

	End Sub



	Sub cboClubs_OnClick()

		'Save the club name the user selects by clicking on the

combo box

		frmDisplay.txtClubName.value =3D _



frmDisplay.cboClubs(frmDisplay.cboClubs.selectedIndex)

	End Sub



	Sub cboClubs_OnChange()

		'Save the club name the user selects by scrolling the

combo

box

		'with the arrow keys

		frmDisplay.txtClubName.value =3D _



frmDisplay.cboClubs(frmDisplay.cboClubs.selectedIndex)

	End Sub

	</script>



<%

'***********************************************************

'* Step 2: Display the form for editing a club

'***********************************************************

ElseIf Request.Form("FormAction") =3D "Step2" Then



	'Create the recordset object

	Set objRS =3D Server.CreateObject("ADODB.Recordset")



	'Set the SQL string





strSQL =3D "Select * from teams Where team_id =3D

'<%=3DRequest.Form(cboClubs)%>'"

	'Open the recordset getting the club details for this club

	objRS.Open strSQL,"dsn=3Drecequip"

%>

<form action=3Dupdated.asp method=3Dpost name=3DfrmUpdate>

	<input type=3Dhidden name=3DAction value=3DUpdate>

	<input type=3Dhidden name=3DtxtClubCode

		value=3D<%=3DRequest.Form(cboClubs)%>>

	<table>

		<tr>

		<td>Team Name</td>

		<td><font color=3Dnavy

face=3Dfantasy><b><%=3DRequest.Form("txtClubName")%></b></font></td>

		<td width=3D10></td>

		<td>Team ID</td>

		<td><font color=3Dnavy

face=3Dfantasy><b><%=3DRequest.Form(cboClubs)%></b></font></td>

		</tr>

		<tr>

		<td nowrap>Coach Name</td>

		<td><input type=3Dtext name=3Dtxtcoach size=3D20

				value=3D<%=3DobjRS("coach")%>></td>

		<td width=3D10></td>

		<td>Phone No.</td>

		<td><input type=3Dtext name=3Dtxtcoachph size=3D14

				value=3D<%=3DobjRS("coachph")%>> </td>

		</tr>

		<tr>

		<td>Contact Name</td>

		<td><input type=3Dtext name=3Dtxtcontact size=3D20

				value=3D<%=3DobjRS("contact")%>></td>

		<td width=3D10></td>





		<td>Phone No.</td>

		<td colspan=3D4>

			<input type=3Dtext name=3Dtxtcontactph size=3D14

				value=3D<%=3DobjRS("contactph")%>></td>

		</tr>





		<tr>

		<td height=3D60><input type=3Dsubmit name=3DbtnSubmit

value=3DSubmit></td>

		</tr>

	</table>

</form>



<%

		'Close and dereference database objects

		objRS.Close

		Set objRS =3D Nothing



End If	'End If for step processing

%>



</BODY>

</HTML>





-----Original Message-----

From: Ken Schaefer [mailto:ken.s@a...]

Sent: Thursday, May 04, 2000 1:22 AM

To: ASP Databases

Subject: [asp_databases] Re: Data Type Mismatch





Is this line within a function? If so, can you give the whole function,

and

also show the lines where the function is being called from?



Also, when debugging SQL statements, do the following:



strSQL =3D "....whatever your string is"

Response.Write strSQL



and then look at what is actually being passed to the database. From 

the

error you are getting I expect that Request.Form(cboClubs) is NULL (ie 

=3D

"")

and so something is screwing up. If you Response.Write strSQL you'll be

able

to see if there is anything there...



Cheers

Ken



----- Original Message -----

From: "Matthew Lohr"

To: "ASP Databases" <asp_databases@p...>

Sent: Thursday, May 04, 2000 3:04 AM

Subject: [asp_databases] Re: Data Type Mismatch





> Great thanks I did this and the error went away.  Alas a new error 

has

risen

> to do battle. Now I get that this requires a string input.  Then when

I

take

> out the qoutes that make my team_id a string I end up with can not

find

name

> or ordinal reference specified.  I have lost my mind.The error

maessage is

> as follows.

>

>

> Update Team Form

>

>

> Request object error 'ASP 0102 : 80004005'

>

> Expecting string input

>

> /lacrosse/Teams/update.asp, line 85

>

> The function expects a string as input. Update Team Form

>

> The first line is 85

>

> strSQL =3D "Select * from teams Where team_id =3D '" & _

> Request.Form(cboClubs) & "'"

>

>







---

You are currently subscribed to asp_databases


$subst('Email.Unsub')





---

You are currently subscribed to asp_databases


$subst('Email.Unsub')



---

You are currently subscribed to asp_databases


$subst('Email.Unsub')





---

You are currently subscribed to asp_databases


$subst('Email.Unsub')

Message #16 by "Matthew Lohr" <mlohr@t...> on Fri, 5 May 2000 10:17:46 -0400
This works.  It causes a few problems in the next page but it works great.

Thank you everyone for your help.  I know I just need to adjust the script

on the next page.  Thanks again



 -----Original Message-----

From: 	Ken Schaefer 

Sent:	Thursday, May 04, 2000 9:01 PM

To:	ASP Databases

Subject:	[asp_databases] Re: Data Type Mismatch







> Microsoft VBScript compilation error '800a0401'

> Expected end of statement

> /lacrosse/Teams/update.asp, line 87

> strSQL = "Select * from teams Where team_id = ' & Request("cboClubs") &' "

> --------------------------------------------------------------------------

--

> --------------^



This is because there is a " missing in the statement...



strSQL = "SELECT * FROM teams "

strSQL = strSQL & "WHERE team_id = " & Request.Form("cboClubs")



will work if the field is numeric. If the field is text, then you need to

use ' around your fieldvalue eg:



strSQL = "SELECT * FROM teams "

strSQL = strSQL & "WHERE team_id = '" & Request.Form("cboClubs") & "'"



HTH



Cheers

Ken



>

>  -----Original Message-----

> From: Árni B. Halldórsson 

> Sent: Thursday, May 04, 2000 10:56 AM

> To: ASP Databases

> Subject: [asp_databases] Re: Data Type Mismatch

>

> strSQL = "Select * from teams Where team_id = ' & Request("cboClubs") &

"'"

>

> This should work.

>

> *------------------*

> * Arni Halldorsson *

> * abh@t...   *

> *------------------*







---

You are currently subscribed to asp_databases





  Return to Index