Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing excel data to spread sheet control

Status
Not open for further replies.

goofy

Programmer
Feb 3, 2001
30
US
Hi
I am trying to import data from an excel sheet to Spreadsheet control.Following code gives Dr.watson error sometimes during the connection.Else its asking for sql statements like insert delete update

Dim vConnString as String
Dim Conn as adodb.Connection
dim oRs as adodb.RecordSet
vConnString = "DRIVER={Microsoft Excel Driver (*.xls)};ReadOnly=1;DBQ=d:\test.xls"
Set Conn = New ADODB.Connection
Conn.Open vConnString
Set oRs = New Adodb.recordset
Set oRs = oConn.Execute("['sheet1']")

Let me know the exact code using which i will be able to import data to a spread sheet control from an excel sheet .
(Using VB to accomplish this)

thanx
Reply ASAP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top