ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How To Query and Update Excel Data Using ADO From ASP (https://www.excelbanter.com/excel-programming/315659-how-query-update-excel-data-using-ado-asp.html)

Stan the Mouse[_2_]

How To Query and Update Excel Data Using ADO From ASP
 
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, I try once by using "addnew", but it actually
filled all my emtpy fields with the same data at once,
can anyone help me please? thanks

e.g.

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, like below:

fldTopic fldName fldFace fldMail fldHomepage
fldContent
Testing4 Mouse 4

Sing
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.
Testing5 Mouse 4

Test again.

until it is full, e.g. upto row 65536 in excel.

Thanks


Jamie Collins

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.

--


All times are GMT +1. The time now is 05:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com