Home |
Search |
Today's Posts |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How To Query and Update Excel Data Using ADO From ASP
"Stan the Mouse" wrote ...
http://support.microsoft.com/?id=195951 In this link, it talks about how to update the Excel by ASP (VB), I would like to know how to add a new data into the field e.g Before I run that ASP, my excel file has a range with data like below: fldTopic fldName fldFace fldMail fldHomepage fldContent Testing4 Mouse 4 Sing After I run the ASP which I would like to only fill in the next data as below: fldTopic fldName fldFace fldMail fldHomepage fldContent Testing4 Mouse 4 Sing Testing5 Mouse 4 Test again. But unfortunately, it fills the range that I've declared until that range is full For ASP, I wouldn't recommend using a recordset to update a data source. I'd use SQL DML: INSERT INTO, UPDATE and DELETE (Excel doesn't support DELETE, though). You Excel table appears to be a defined Name ('named Range') which extends to row 65536 on a worksheet. This would mean you table is already full, albeit with nulls! Better to define the Name's range to coincide with the UsedRange (i.e. just the part with data), in which case it would expand to fit inserted rows, or use the sheet name as the table name (possibly with a Range address if required). So, for your example, I'd use: INSERT INTO [MySheet$] (fldTopic, fldName, fldFace, fldMail, fldHomepage, fldContent) VALUES ('Testing5', 'Mouse', NULL, 4, ', 'Test again') ; Jamie. -- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Update Web Query | Excel Discussion (Misc queries) | |||
How to update ORACLE query definition in Excel file | Links and Linking in Excel | |||
Use Excel to make an update query to another database table? | Excel Discussion (Misc queries) | |||
1-variable Data Table dependent on MS Query fails to update correctly | Excel Discussion (Misc queries) | |||
How access/query/update Excel using VC? | Excel Programming |