If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > DataType Error with Excel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-21-04, 06:02
AsimKhaliq AsimKhaliq is offline
Registered User
 
Join Date: Jan 2004
Posts: 3
DataType Error with Excel

Hi Guys

'for Excel Sheet
file=Server.mappath("Test2.xls")
Set cn =server.createObject("ADODB.Connection")
cn.open"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&file&";" &_
"Extended Properties=Excel 8.0;Persist Security Info=False"
Set rs = Server.Createobject("ADODB.Recordset")
rs.Open "Select * from [sht1$]", cn, 3, 2

name="Mike"
class1="8th"
sal=cint(125)
marks=cint(100)

rs.AddNew
rs.Fields(0).Value = name
rs.Fields(1).Value = class1
rs.Fields(2).Value = sal
rs.Fields(3).Value = marks
rs.Update
Note : Sal and mark has int value and tthats what i need in My excel.

Now My problem is datatype when I sumbit this value to excel Sheet my SAL and MARKS column have text datatype there in excel, which is incorrect.
Can anyone help me .
Thnx in Adv

Last edited by AsimKhaliq; 01-21-04 at 06:04.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On