VBScript Error due to converting databases from Access to SQL Server 6.5 
Author Message
 VBScript Error due to converting databases from Access to SQL Server 6.5

I have an ASP application that is running against a SQL Server 6.5 db. I
recently converted the db from Access to SQL and have been confronted with
some errors.

One error I received was:
"Disallowed implicit conversion from datatype 'int' to datatype 'varchar'."

I fixed that error by adding a CONVERT function to the SQL statement within
the ASP code, but now receive another error. Does someone have any ideas how
I could resolve this VBScript error:

Microsoft VBScript runtime error '800a000d'

Type mismatch: 'CONVERT'

/hfcu/admin/messages/add.asp, line 15

The code is used as follows (the convert function is the last line & where
the error happens):
 sSQL="INSERT into messages
(msgType,msgSummary,msgText,effectiveDate,effectiveDa{*filter*}d,last_mod_dt,last_
mod_id) VALUES (" & _
 cbxType & "," & _
 "'" & summary & "'," & _
 "'" & message & "'," & _
 "'" & date1 & "'," & _
 "'" & date2 & "'," & _
 "'" & now() & "'," & _
 CONVERT(varchar,Session("adminID")) & ")"



Fri, 18 Jan 2002 03:00:00 GMT  
 VBScript Error due to converting databases from Access to SQL Server 6.5
Never had the problem because I don't work with SQL Server that often,
but maybe there is more information needed about the VarChar data
type.  Like in Oracle there is precision and length.  So instead of a
basic integer or long or whatever in Access you have one VarChar with
those properties for all numeric data.  Hope this helps a little.

Quote:
> I have an ASP application that is running against a SQL Server 6.5
db. I
> recently converted the db from Access to SQL and have been confronted
with
> some errors.

> One error I received was:
> "Disallowed implicit conversion from datatype 'int' to datatype
'varchar'."

> I fixed that error by adding a CONVERT function to the SQL statement
within
> the ASP code, but now receive another error. Does someone have any
ideas how
> I could resolve this VBScript error:

> Microsoft VBScript runtime error '800a000d'

> Type mismatch: 'CONVERT'

> /hfcu/admin/messages/add.asp, line 15

> The code is used as follows (the convert function is the last line &
where
> the error happens):
>  sSQL="INSERT into messages

(msgType,msgSummary,msgText,effectiveDate,effectiveDa{*filter*}d,last_mod_dt,l
ast_

Quote:
> mod_id) VALUES (" & _
>  cbxType & "," & _
>  "'" & summary & "'," & _
>  "'" & message & "'," & _
>  "'" & date1 & "'," & _
>  "'" & date2 & "'," & _
>  "'" & now() & "'," & _
>  CONVERT(varchar,Session("adminID")) & ")"

--
Junebug
Chillin on a leaf  ;-)--~

Sent via Deja.com http://www.*-*-*.com/
Share what you know. Learn what you don't.



Sat, 19 Jan 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. I need, must have program for converting Access DB to SQL server 6.5 Script

2. SQL Server 6.5 Database Access

3. ASP, SQL Server 6.5, VBScript, HELP!!!

4. Writing data from VB 5.0 to a SQL Server 6.5 database

5. Help needed: User permissions in a SQL Server 6.5 database

6. Writing data from VB 5.0 to a SQL Server 6.5 database

7. Data objects closed error in ADO 2.1 and SQL server 6.5

8. sql server 6.5 ado error

9. Error doing update with VB 3.0 and SQL Server 6.5

10. Connection errors with Visual Basic 4 16-bit and SQL server 6.5 on a 3.11 platform

11. ODBC error after upgrading to Microsoft SQL server 6.5

12. Error 20532 Crystal 6, SQL Server 6.5 and VB5

 

 
Powered by phpBB® Forum Software