Cannot update Database or object is read-only

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What's wrong with this code:

INSERT INTO [Excel 8.0;Database="C:\Documents and
Settings\Administrator\Desktop\test.xls"].Report SELECT * FROM count_preb;

any help will be much appreciated.

//neb
 
neb said:
What's wrong with this code:

INSERT INTO [Excel 8.0;Database="C:\Documents and
Settings\Administrator\Desktop\test.xls"].Report SELECT * FROM count_preb;

any help will be much appreciated.

Try removing the quotes and appending a semicolon separator to the
filename e.g.

INSERT INTO [Excel 8.0;Database=C:\Documents and
Settings\Administrator\Desktop\test.xls;].Report SELECT * FROM
count_preb;

Even better would be to supply column names (SELECT * is not for
production code) e.g.

INSERT INTO [Excel 8.0;HDR=Yes;Database=C:\Documents and
Settings\Administrator\Desktop\test.xls;].Report (xlcol1, xlcol2,
xlcol3)
SELECT col1, col2, col3
FROM count_preb;

Jamie.

--
 
Your question has already been answered somewhere else that you posted the
same thing.

Please do not fragment the responses by posting the same question multiple
times in multiple groups.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top