RE: Atteched DB's only "read only"



Hi Matt,

I tried to repro the behavior you are seeing on both MS SQL Server 2000 and
2005 but was unsuccessful. Can you elaborate on how the database was
detached, and the JDBC Driver version used? Additionally, snippets of java
code and the exception stack trace would greatly help. My snippet of code
that worked for me was:

Statement stmt = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_UPDATABLE);
stmt.executeUpdate("use master");
stmt.executeUpdate("exec sp_attach_db @dbname=N'Sampledb', @filename1=N'" +
primary + "', @filename2=N'" + logs + "'");
stmt.executeUpdate("use Sampledb");
stmt.executeUpdate("create table test (c1 int)");
stmt.executeUpdate("insert into test values(888)");
ResultSet rs = stmt.executeQuery("select * from test");
rs.updateInt(1, 12345);
rs.updateRow();

Thanks,
Jaaved Mohammed [MSFT]

.



Relevant Pages

  • OOo Base interaction with ooRexx ...
    ... since today the ooRexx interaction with OpenOffice' database are available via the ... official OOo snippets page at: ... These nutshell examples stem from the following work of a student ...
    (comp.lang.rexx)
  • HtmlEncode and NText
    ... I'm writing a utility that will read HTML pages and snippets and store them ... in a database. ... I plan to HtmlEncode the text prior to writing it to the ...
    (microsoft.public.dotnet.framework.aspnet)

Loading