Results 1 to 1 of 1
  1. #1
    Join Date
    Jan 2004
    Posts
    3

    Unanswered: 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 07:04.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •