trouble with web forms

Discussion in 'ASP .Net' started by somersbar@yahoo.com, Feb 16, 2006.

  1. Guest

    im trying to get a table from a microsoft access database on a simple
    web form using visual basic.net. ive set up the database as a file
    dsn.

    this is my connection string:

    DBQ=C:\Program Files\Microsoft
    Office\OFFICE11\SAMPLES\Northwind.mdb;DefaultDir=C:\Program
    Files\Microsoft Office\OFFICE11\SAMPLES;Driver={Microsoft Access Driver
    (*.mdb)};DriverId=25;FIL=MS Access;FILEDSN=C:\Program Files\Common
    Files\ODBC\Data
    Sources\test2.dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;


    works fine when i try it with a windows form, however with the webform,
    when i try it, i get the following errors because of line69 :


    ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error
    Unable to open registry key 'Temporary (volatile) Jet DSN for process
    0x3a4 Thread 0x720 DBC 0x437aa4 Jet'. ERROR [IM006] [Microsoft][ODBC
    Driver Manager] Driver's SQLSetConnectAttr failed ERROR [HY000]
    [Microsoft][ODBC Microsoft Access Driver]General error Unable to open
    registry key 'Temporary (volatile) Jet DSN for process 0x3a4 Thread
    0x720 DBC 0x437aa4 Jet'. ERROR [HY000] [Microsoft][ODBC Microsoft
    Access Driver] Could not use '(unknown)'; file already in use. ERROR
    [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable
    to open registry key 'Temporary (volatile) Jet DSN for process 0x3a4
    Thread 0x720 DBC 0x437aa4 Jet'. ERROR [HY000] [Microsoft][ODBC
    Microsoft Access Driver]General error Unable to open registry key
    'Temporary (volatile) Jet DSN for process 0x3a4 Thread 0x720 DBC
    0x437aa4 Jet'. ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]
    Could not use '(unknown)'; file already in use.

    Description: An unhandled exception occurred during the execution of
    the current web request. Please review the stack trace for more
    information about the error and where it originated in the code.

    Exception Details: System.Data.Odbc.OdbcException: ERROR [HY000]
    [Microsoft][ODBC Microsoft Access Driver]General error Unable to open
    registry key 'Temporary (volatile) Jet DSN for process 0x3a4 Thread
    0x720 DBC 0x437aa4 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager]
    Driver's SQLSetConnectAttr failed ERROR [HY000] [Microsoft][ODBC
    Microsoft Access Driver]General error Unable to open registry key
    'Temporary (volatile) Jet DSN for process 0x3a4 Thread 0x720 DBC
    0x437aa4 Jet'. ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]
    Could not use '(unknown)'; file already in use. ERROR [HY000]
    [Microsoft][ODBC Microsoft Access Driver]General error Unable to open
    registry key 'Temporary (volatile) Jet DSN for process 0x3a4 Thread
    0x720 DBC 0x437aa4 Jet'. ERROR [HY000] [Microsoft][ODBC Microsoft
    Access Driver]General error Unable to open registry key 'Temporary
    (volatile) Jet DSN for process 0x3a4 Thread 0x720 DBC 0x437aa4 Jet'.
    ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] Could not use
    '(unknown)'; file already in use.

    Source Error:

    Line 67: Private Sub Page_Load(ByVal sender As System.Object, ByVal
    e As System.EventArgs) Handles MyBase.Load
    Line 68: DataSet11.Clear()
    Line 69: OdbcDataAdapter1.Fill(DataSet11)
    Line 70: DataGrid1.DataBind()
    Line 71: End Sub


    Source File: c:\inetpub\wwwroot\TestWeb1\WebForm1.aspx.vb Line: 69

    Stack Trace:

    [OdbcException: ERROR [HY000] [Microsoft][ODBC Microsoft Access
    Driver]General error Unable to open registry key 'Temporary (volatile)
    Jet DSN for process 0x3a4 Thread 0x720 DBC 0x437aa4 Jet'.
    ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's
    SQLSetConnectAttr failed
    ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error
    Unable to open registry key 'Temporary (volatile) Jet DSN for process
    0x3a4 Thread 0x720 DBC 0x437aa4 Jet'.
    ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] Could not use
    '(unknown)'; file already in use.
    ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error
    Unable to open registry key 'Temporary (volatile) Jet DSN for process
    0x3a4 Thread 0x720 DBC 0x437aa4 Jet'.
    ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error
    Unable to open registry key 'Temporary (volatile) Jet DSN for process
    0x3a4 Thread 0x720 DBC 0x437aa4 Jet'.
    ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] Could not use
    '(unknown)'; file already in use.]
    System.Data.Odbc.OdbcConnection.Open()
    System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
    ConnectionState& originalState)
    System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
    startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    CommandBehavior behavior)
    System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
    startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    CommandBehavior behavior)
    System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
    TestWeb1.WebForm1.Page_Load(Object sender, EventArgs e) in
    c:\inetpub\wwwroot\TestWeb1\WebForm1.aspx.vb:69
    System.Web.UI.Control.OnLoad(EventArgs e)
    System.Web.UI.Control.LoadRecursive()
    System.Web.UI.Page.ProcessRequestMain()





    This is my code:

    Public Class WebForm1
    Inherits System.Web.UI.Page

    #Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub
    InitializeComponent()
    Me.OdbcSelectCommand1 = New System.Data.Odbc.OdbcCommand
    Me.OdbcInsertCommand1 = New System.Data.Odbc.OdbcCommand
    Me.OdbcConnection1 = New System.Data.Odbc.OdbcConnection
    Me.OdbcDataAdapter1 = New System.Data.Odbc.OdbcDataAdapter
    Me.DataSet11 = New TestWeb1.DataSet1
    CType(Me.DataSet11,
    System.ComponentModel.ISupportInitialize).BeginInit()
    '
    'OdbcSelectCommand1
    '
    Me.OdbcSelectCommand1.CommandText = "SELECT ShipperID,
    CompanyName, Phone FROM Shippers"
    Me.OdbcSelectCommand1.Connection = Me.OdbcConnection1
    '
    'OdbcInsertCommand1
    '
    Me.OdbcInsertCommand1.CommandText = "INSERT INTO
    Shippers(CompanyName, Phone) VALUES (?, ?)"
    Me.OdbcInsertCommand1.Connection = Me.OdbcConnection1
    Me.OdbcInsertCommand1.Parameters.Add(New
    System.Data.Odbc.OdbcParameter("CompanyName",
    System.Data.Odbc.OdbcType.NVarChar, 40, "CompanyName"))
    Me.OdbcInsertCommand1.Parameters.Add(New
    System.Data.Odbc.OdbcParameter("Phone",
    System.Data.Odbc.OdbcType.NVarChar, 24, "Phone"))
    '
    'OdbcConnection1
    '
    Me.OdbcConnection1.ConnectionString =
    "PageTimeout=5;MaxScanRows=8;DefaultDir=C:\Program Files\Microsoft
    Office\OFFICE11" & _
    "\SAMPLES;FILEDSN=C:\Program Files\Common Files\ODBC\Data
    Sources\test2.dsn;Drive" & _
    "rId=25;DBQ=C:\Program Files\Microsoft
    Office\OFFICE11\SAMPLES\Northwind.mdb;User" & _
    "CommitSync=Yes;FIL=MS Access;UID=admin;Driver={Microsoft
    Access Driver (*.mdb)};" & _
    "MaxBufferSize=2048;Threads=3;SafeTransactions=0"
    '
    'OdbcDataAdapter1
    '
    Me.OdbcDataAdapter1.InsertCommand = Me.OdbcInsertCommand1
    Me.OdbcDataAdapter1.SelectCommand = Me.OdbcSelectCommand1
    Me.OdbcDataAdapter1.TableMappings.AddRange(New
    System.Data.Common.DataTableMapping() {New
    System.Data.Common.DataTableMapping("Table", "Shippers", New
    System.Data.Common.DataColumnMapping() {New
    System.Data.Common.DataColumnMapping("ShipperID", "ShipperID"), New
    System.Data.Common.DataColumnMapping("CompanyName", "CompanyName"), New
    System.Data.Common.DataColumnMapping("Phone", "Phone")})})
    '
    'DataSet11
    '
    Me.DataSet11.DataSetName = "DataSet1"
    Me.DataSet11.Locale = New
    System.Globalization.CultureInfo("en-IE")
    CType(Me.DataSet11,
    System.ComponentModel.ISupportInitialize).EndInit()

    End Sub
    Protected WithEvents OdbcSelectCommand1 As
    System.Data.Odbc.OdbcCommand
    Protected WithEvents OdbcInsertCommand1 As
    System.Data.Odbc.OdbcCommand
    Protected WithEvents OdbcConnection1 As
    System.Data.Odbc.OdbcConnection
    Protected WithEvents OdbcDataAdapter1 As
    System.Data.Odbc.OdbcDataAdapter
    Protected WithEvents DataSet11 As TestWeb1.DataSet1
    Protected WithEvents DataGrid1 As
    System.Web.UI.WebControls.DataGrid

    'NOTE: The following placeholder declaration is required by the Web
    Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles MyBase.Init
    'CODEGEN: This method call is required by the Web Form Designer
    'Do not modify it using the code editor.
    InitializeComponent()
    End Sub

    #End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles MyBase.Load
    DataSet11.Clear()
    OdbcDataAdapter1.Fill(DataSet11)
    DataGrid1.DataBind()
    End Sub

    End Class


    iv been tryin to sort this for a couple of days but am completely at a
    loss as to how to sort this. Can anyone help?
    , Feb 16, 2006
    #1
    1. Advertising

  2. Well, I could be wrong since I haven't seen every detail of your setup or
    code, but that looks like a very strange connection string. Here are some
    things I would check:

    1. Directories rarely start with the drive letter (C:) when dealing with the
    web.
    2. Your connection string looks much more complicated than necessary. Here
    is the line that I use to create my connections in all the websites I have
    created that use Access databases (and they have been on different servers,
    so unless you have a strange setup I'm guessing it will work for you too):

    Dim myconnection As New
    OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" &
    Server.MapPath("/mydatabase.mdb"))

    Just modify the last part to be the correct path to your *.mdb file.

    3. Check the permissions on the *.mdb file to make sure ASPNET has
    permission to access it.

    Although something that I am kind of getting the impression of is that you
    require a more full-featured and secure database, Access was not really
    intended for web-related stuff. If you have a very big company or plan to
    use the database heavily, I would put in the effort and money to buy either
    Oracle or SQL Server (you would probably prefer SQL Server since you are
    coming from Access). I am only a student, but ASP.NET and Web Development
    are my areas of concentration and these are things I have been taught and
    gained through experience and articles I have read. Good Luck!
    --
    Nathan Sokalski

    http://www.nathansokalski.com/

    <> wrote in message
    news:...
    > im trying to get a table from a microsoft access database on a simple
    > web form using visual basic.net. ive set up the database as a file
    > dsn.
    >
    > this is my connection string:
    >
    > DBQ=C:\Program Files\Microsoft
    > Office\OFFICE11\SAMPLES\Northwind.mdb;DefaultDir=C:\Program
    > Files\Microsoft Office\OFFICE11\SAMPLES;Driver={Microsoft Access Driver
    > (*.mdb)};DriverId=25;FIL=MS Access;FILEDSN=C:\Program Files\Common
    > Files\ODBC\Data
    > Sources\test2.dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;
    >
    >
    > works fine when i try it with a windows form, however with the webform,
    > when i try it, i get the following errors because of line69 :
    >
    >
    > ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error
    > Unable to open registry key 'Temporary (volatile) Jet DSN for process
    > 0x3a4 Thread 0x720 DBC 0x437aa4 Jet'. ERROR [IM006] [Microsoft][ODBC
    > Driver Manager] Driver's SQLSetConnectAttr failed ERROR [HY000]
    > [Microsoft][ODBC Microsoft Access Driver]General error Unable to open
    > registry key 'Temporary (volatile) Jet DSN for process 0x3a4 Thread
    > 0x720 DBC 0x437aa4 Jet'. ERROR [HY000] [Microsoft][ODBC Microsoft
    > Access Driver] Could not use '(unknown)'; file already in use. ERROR
    > [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable
    > to open registry key 'Temporary (volatile) Jet DSN for process 0x3a4
    > Thread 0x720 DBC 0x437aa4 Jet'. ERROR [HY000] [Microsoft][ODBC
    > Microsoft Access Driver]General error Unable to open registry key
    > 'Temporary (volatile) Jet DSN for process 0x3a4 Thread 0x720 DBC
    > 0x437aa4 Jet'. ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]
    > Could not use '(unknown)'; file already in use.
    >
    > Description: An unhandled exception occurred during the execution of
    > the current web request. Please review the stack trace for more
    > information about the error and where it originated in the code.
    >
    > Exception Details: System.Data.Odbc.OdbcException: ERROR [HY000]
    > [Microsoft][ODBC Microsoft Access Driver]General error Unable to open
    > registry key 'Temporary (volatile) Jet DSN for process 0x3a4 Thread
    > 0x720 DBC 0x437aa4 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager]
    > Driver's SQLSetConnectAttr failed ERROR [HY000] [Microsoft][ODBC
    > Microsoft Access Driver]General error Unable to open registry key
    > 'Temporary (volatile) Jet DSN for process 0x3a4 Thread 0x720 DBC
    > 0x437aa4 Jet'. ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]
    > Could not use '(unknown)'; file already in use. ERROR [HY000]
    > [Microsoft][ODBC Microsoft Access Driver]General error Unable to open
    > registry key 'Temporary (volatile) Jet DSN for process 0x3a4 Thread
    > 0x720 DBC 0x437aa4 Jet'. ERROR [HY000] [Microsoft][ODBC Microsoft
    > Access Driver]General error Unable to open registry key 'Temporary
    > (volatile) Jet DSN for process 0x3a4 Thread 0x720 DBC 0x437aa4 Jet'.
    > ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] Could not use
    > '(unknown)'; file already in use.
    >
    > Source Error:
    >
    > Line 67: Private Sub Page_Load(ByVal sender As System.Object, ByVal
    > e As System.EventArgs) Handles MyBase.Load
    > Line 68: DataSet11.Clear()
    > Line 69: OdbcDataAdapter1.Fill(DataSet11)
    > Line 70: DataGrid1.DataBind()
    > Line 71: End Sub
    >
    >
    > Source File: c:\inetpub\wwwroot\TestWeb1\WebForm1.aspx.vb Line: 69
    >
    > Stack Trace:
    >
    > [OdbcException: ERROR [HY000] [Microsoft][ODBC Microsoft Access
    > Driver]General error Unable to open registry key 'Temporary (volatile)
    > Jet DSN for process 0x3a4 Thread 0x720 DBC 0x437aa4 Jet'.
    > ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's
    > SQLSetConnectAttr failed
    > ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error
    > Unable to open registry key 'Temporary (volatile) Jet DSN for process
    > 0x3a4 Thread 0x720 DBC 0x437aa4 Jet'.
    > ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] Could not use
    > '(unknown)'; file already in use.
    > ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error
    > Unable to open registry key 'Temporary (volatile) Jet DSN for process
    > 0x3a4 Thread 0x720 DBC 0x437aa4 Jet'.
    > ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error
    > Unable to open registry key 'Temporary (volatile) Jet DSN for process
    > 0x3a4 Thread 0x720 DBC 0x437aa4 Jet'.
    > ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] Could not use
    > '(unknown)'; file already in use.]
    > System.Data.Odbc.OdbcConnection.Open()
    > System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
    > ConnectionState& originalState)
    > System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
    > startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    > CommandBehavior behavior)
    > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
    > startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    > CommandBehavior behavior)
    > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
    > TestWeb1.WebForm1.Page_Load(Object sender, EventArgs e) in
    > c:\inetpub\wwwroot\TestWeb1\WebForm1.aspx.vb:69
    > System.Web.UI.Control.OnLoad(EventArgs e)
    > System.Web.UI.Control.LoadRecursive()
    > System.Web.UI.Page.ProcessRequestMain()
    >
    >
    >
    >
    >
    > This is my code:
    >
    > Public Class WebForm1
    > Inherits System.Web.UI.Page
    >
    > #Region " Web Form Designer Generated Code "
    >
    > 'This call is required by the Web Form Designer.
    > <System.Diagnostics.DebuggerStepThrough()> Private Sub
    > InitializeComponent()
    > Me.OdbcSelectCommand1 = New System.Data.Odbc.OdbcCommand
    > Me.OdbcInsertCommand1 = New System.Data.Odbc.OdbcCommand
    > Me.OdbcConnection1 = New System.Data.Odbc.OdbcConnection
    > Me.OdbcDataAdapter1 = New System.Data.Odbc.OdbcDataAdapter
    > Me.DataSet11 = New TestWeb1.DataSet1
    > CType(Me.DataSet11,
    > System.ComponentModel.ISupportInitialize).BeginInit()
    > '
    > 'OdbcSelectCommand1
    > '
    > Me.OdbcSelectCommand1.CommandText = "SELECT ShipperID,
    > CompanyName, Phone FROM Shippers"
    > Me.OdbcSelectCommand1.Connection = Me.OdbcConnection1
    > '
    > 'OdbcInsertCommand1
    > '
    > Me.OdbcInsertCommand1.CommandText = "INSERT INTO
    > Shippers(CompanyName, Phone) VALUES (?, ?)"
    > Me.OdbcInsertCommand1.Connection = Me.OdbcConnection1
    > Me.OdbcInsertCommand1.Parameters.Add(New
    > System.Data.Odbc.OdbcParameter("CompanyName",
    > System.Data.Odbc.OdbcType.NVarChar, 40, "CompanyName"))
    > Me.OdbcInsertCommand1.Parameters.Add(New
    > System.Data.Odbc.OdbcParameter("Phone",
    > System.Data.Odbc.OdbcType.NVarChar, 24, "Phone"))
    > '
    > 'OdbcConnection1
    > '
    > Me.OdbcConnection1.ConnectionString =
    > "PageTimeout=5;MaxScanRows=8;DefaultDir=C:\Program Files\Microsoft
    > Office\OFFICE11" & _
    > "\SAMPLES;FILEDSN=C:\Program Files\Common Files\ODBC\Data
    > Sources\test2.dsn;Drive" & _
    > "rId=25;DBQ=C:\Program Files\Microsoft
    > Office\OFFICE11\SAMPLES\Northwind.mdb;User" & _
    > "CommitSync=Yes;FIL=MS Access;UID=admin;Driver={Microsoft
    > Access Driver (*.mdb)};" & _
    > "MaxBufferSize=2048;Threads=3;SafeTransactions=0"
    > '
    > 'OdbcDataAdapter1
    > '
    > Me.OdbcDataAdapter1.InsertCommand = Me.OdbcInsertCommand1
    > Me.OdbcDataAdapter1.SelectCommand = Me.OdbcSelectCommand1
    > Me.OdbcDataAdapter1.TableMappings.AddRange(New
    > System.Data.Common.DataTableMapping() {New
    > System.Data.Common.DataTableMapping("Table", "Shippers", New
    > System.Data.Common.DataColumnMapping() {New
    > System.Data.Common.DataColumnMapping("ShipperID", "ShipperID"), New
    > System.Data.Common.DataColumnMapping("CompanyName", "CompanyName"), New
    > System.Data.Common.DataColumnMapping("Phone", "Phone")})})
    > '
    > 'DataSet11
    > '
    > Me.DataSet11.DataSetName = "DataSet1"
    > Me.DataSet11.Locale = New
    > System.Globalization.CultureInfo("en-IE")
    > CType(Me.DataSet11,
    > System.ComponentModel.ISupportInitialize).EndInit()
    >
    > End Sub
    > Protected WithEvents OdbcSelectCommand1 As
    > System.Data.Odbc.OdbcCommand
    > Protected WithEvents OdbcInsertCommand1 As
    > System.Data.Odbc.OdbcCommand
    > Protected WithEvents OdbcConnection1 As
    > System.Data.Odbc.OdbcConnection
    > Protected WithEvents OdbcDataAdapter1 As
    > System.Data.Odbc.OdbcDataAdapter
    > Protected WithEvents DataSet11 As TestWeb1.DataSet1
    > Protected WithEvents DataGrid1 As
    > System.Web.UI.WebControls.DataGrid
    >
    > 'NOTE: The following placeholder declaration is required by the Web
    > Form Designer.
    > 'Do not delete or move it.
    > Private designerPlaceholderDeclaration As System.Object
    >
    > Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles MyBase.Init
    > 'CODEGEN: This method call is required by the Web Form Designer
    > 'Do not modify it using the code editor.
    > InitializeComponent()
    > End Sub
    >
    > #End Region
    >
    > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles MyBase.Load
    > DataSet11.Clear()
    > OdbcDataAdapter1.Fill(DataSet11)
    > DataGrid1.DataBind()
    > End Sub
    >
    > End Class
    >
    >
    > iv been tryin to sort this for a couple of days but am completely at a
    > loss as to how to sort this. Can anyone help?
    >
    Nathan Sokalski, Feb 17, 2006
    #2
    1. Advertising

  3. Do you have Office installed on your server?
    --
    Christopher A. Reed
    "The oxen are slow, but the earth is patient."

    <> wrote in message
    news:...
    > im trying to get a table from a microsoft access database on a simple
    > web form using visual basic.net. ive set up the database as a file
    > dsn.
    >
    > this is my connection string:
    >
    > DBQ=C:\Program Files\Microsoft
    > Office\OFFICE11\SAMPLES\Northwind.mdb;DefaultDir=C:\Program
    > Files\Microsoft Office\OFFICE11\SAMPLES;Driver={Microsoft Access Driver
    > (*.mdb)};DriverId=25;FIL=MS Access;FILEDSN=C:\Program Files\Common
    > Files\ODBC\Data
    > Sources\test2.dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;
    >
    >
    > works fine when i try it with a windows form, however with the webform,
    > when i try it, i get the following errors because of line69 :
    >
    >
    > ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error
    > Unable to open registry key 'Temporary (volatile) Jet DSN for process
    > 0x3a4 Thread 0x720 DBC 0x437aa4 Jet'. ERROR [IM006] [Microsoft][ODBC
    > Driver Manager] Driver's SQLSetConnectAttr failed ERROR [HY000]
    > [Microsoft][ODBC Microsoft Access Driver]General error Unable to open
    > registry key 'Temporary (volatile) Jet DSN for process 0x3a4 Thread
    > 0x720 DBC 0x437aa4 Jet'. ERROR [HY000] [Microsoft][ODBC Microsoft
    > Access Driver] Could not use '(unknown)'; file already in use. ERROR
    > [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable
    > to open registry key 'Temporary (volatile) Jet DSN for process 0x3a4
    > Thread 0x720 DBC 0x437aa4 Jet'. ERROR [HY000] [Microsoft][ODBC
    > Microsoft Access Driver]General error Unable to open registry key
    > 'Temporary (volatile) Jet DSN for process 0x3a4 Thread 0x720 DBC
    > 0x437aa4 Jet'. ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]
    > Could not use '(unknown)'; file already in use.
    >
    > Description: An unhandled exception occurred during the execution of
    > the current web request. Please review the stack trace for more
    > information about the error and where it originated in the code.
    >
    > Exception Details: System.Data.Odbc.OdbcException: ERROR [HY000]
    > [Microsoft][ODBC Microsoft Access Driver]General error Unable to open
    > registry key 'Temporary (volatile) Jet DSN for process 0x3a4 Thread
    > 0x720 DBC 0x437aa4 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager]
    > Driver's SQLSetConnectAttr failed ERROR [HY000] [Microsoft][ODBC
    > Microsoft Access Driver]General error Unable to open registry key
    > 'Temporary (volatile) Jet DSN for process 0x3a4 Thread 0x720 DBC
    > 0x437aa4 Jet'. ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]
    > Could not use '(unknown)'; file already in use. ERROR [HY000]
    > [Microsoft][ODBC Microsoft Access Driver]General error Unable to open
    > registry key 'Temporary (volatile) Jet DSN for process 0x3a4 Thread
    > 0x720 DBC 0x437aa4 Jet'. ERROR [HY000] [Microsoft][ODBC Microsoft
    > Access Driver]General error Unable to open registry key 'Temporary
    > (volatile) Jet DSN for process 0x3a4 Thread 0x720 DBC 0x437aa4 Jet'.
    > ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] Could not use
    > '(unknown)'; file already in use.
    >
    > Source Error:
    >
    > Line 67: Private Sub Page_Load(ByVal sender As System.Object, ByVal
    > e As System.EventArgs) Handles MyBase.Load
    > Line 68: DataSet11.Clear()
    > Line 69: OdbcDataAdapter1.Fill(DataSet11)
    > Line 70: DataGrid1.DataBind()
    > Line 71: End Sub
    >
    >
    > Source File: c:\inetpub\wwwroot\TestWeb1\WebForm1.aspx.vb Line: 69
    >
    > Stack Trace:
    >
    > [OdbcException: ERROR [HY000] [Microsoft][ODBC Microsoft Access
    > Driver]General error Unable to open registry key 'Temporary (volatile)
    > Jet DSN for process 0x3a4 Thread 0x720 DBC 0x437aa4 Jet'.
    > ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's
    > SQLSetConnectAttr failed
    > ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error
    > Unable to open registry key 'Temporary (volatile) Jet DSN for process
    > 0x3a4 Thread 0x720 DBC 0x437aa4 Jet'.
    > ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] Could not use
    > '(unknown)'; file already in use.
    > ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error
    > Unable to open registry key 'Temporary (volatile) Jet DSN for process
    > 0x3a4 Thread 0x720 DBC 0x437aa4 Jet'.
    > ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error
    > Unable to open registry key 'Temporary (volatile) Jet DSN for process
    > 0x3a4 Thread 0x720 DBC 0x437aa4 Jet'.
    > ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] Could not use
    > '(unknown)'; file already in use.]
    > System.Data.Odbc.OdbcConnection.Open()
    > System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
    > ConnectionState& originalState)
    > System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
    > startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    > CommandBehavior behavior)
    > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
    > startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    > CommandBehavior behavior)
    > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
    > TestWeb1.WebForm1.Page_Load(Object sender, EventArgs e) in
    > c:\inetpub\wwwroot\TestWeb1\WebForm1.aspx.vb:69
    > System.Web.UI.Control.OnLoad(EventArgs e)
    > System.Web.UI.Control.LoadRecursive()
    > System.Web.UI.Page.ProcessRequestMain()
    >
    >
    >
    >
    >
    > This is my code:
    >
    > Public Class WebForm1
    > Inherits System.Web.UI.Page
    >
    > #Region " Web Form Designer Generated Code "
    >
    > 'This call is required by the Web Form Designer.
    > <System.Diagnostics.DebuggerStepThrough()> Private Sub
    > InitializeComponent()
    > Me.OdbcSelectCommand1 = New System.Data.Odbc.OdbcCommand
    > Me.OdbcInsertCommand1 = New System.Data.Odbc.OdbcCommand
    > Me.OdbcConnection1 = New System.Data.Odbc.OdbcConnection
    > Me.OdbcDataAdapter1 = New System.Data.Odbc.OdbcDataAdapter
    > Me.DataSet11 = New TestWeb1.DataSet1
    > CType(Me.DataSet11,
    > System.ComponentModel.ISupportInitialize).BeginInit()
    > '
    > 'OdbcSelectCommand1
    > '
    > Me.OdbcSelectCommand1.CommandText = "SELECT ShipperID,
    > CompanyName, Phone FROM Shippers"
    > Me.OdbcSelectCommand1.Connection = Me.OdbcConnection1
    > '
    > 'OdbcInsertCommand1
    > '
    > Me.OdbcInsertCommand1.CommandText = "INSERT INTO
    > Shippers(CompanyName, Phone) VALUES (?, ?)"
    > Me.OdbcInsertCommand1.Connection = Me.OdbcConnection1
    > Me.OdbcInsertCommand1.Parameters.Add(New
    > System.Data.Odbc.OdbcParameter("CompanyName",
    > System.Data.Odbc.OdbcType.NVarChar, 40, "CompanyName"))
    > Me.OdbcInsertCommand1.Parameters.Add(New
    > System.Data.Odbc.OdbcParameter("Phone",
    > System.Data.Odbc.OdbcType.NVarChar, 24, "Phone"))
    > '
    > 'OdbcConnection1
    > '
    > Me.OdbcConnection1.ConnectionString =
    > "PageTimeout=5;MaxScanRows=8;DefaultDir=C:\Program Files\Microsoft
    > Office\OFFICE11" & _
    > "\SAMPLES;FILEDSN=C:\Program Files\Common Files\ODBC\Data
    > Sources\test2.dsn;Drive" & _
    > "rId=25;DBQ=C:\Program Files\Microsoft
    > Office\OFFICE11\SAMPLES\Northwind.mdb;User" & _
    > "CommitSync=Yes;FIL=MS Access;UID=admin;Driver={Microsoft
    > Access Driver (*.mdb)};" & _
    > "MaxBufferSize=2048;Threads=3;SafeTransactions=0"
    > '
    > 'OdbcDataAdapter1
    > '
    > Me.OdbcDataAdapter1.InsertCommand = Me.OdbcInsertCommand1
    > Me.OdbcDataAdapter1.SelectCommand = Me.OdbcSelectCommand1
    > Me.OdbcDataAdapter1.TableMappings.AddRange(New
    > System.Data.Common.DataTableMapping() {New
    > System.Data.Common.DataTableMapping("Table", "Shippers", New
    > System.Data.Common.DataColumnMapping() {New
    > System.Data.Common.DataColumnMapping("ShipperID", "ShipperID"), New
    > System.Data.Common.DataColumnMapping("CompanyName", "CompanyName"), New
    > System.Data.Common.DataColumnMapping("Phone", "Phone")})})
    > '
    > 'DataSet11
    > '
    > Me.DataSet11.DataSetName = "DataSet1"
    > Me.DataSet11.Locale = New
    > System.Globalization.CultureInfo("en-IE")
    > CType(Me.DataSet11,
    > System.ComponentModel.ISupportInitialize).EndInit()
    >
    > End Sub
    > Protected WithEvents OdbcSelectCommand1 As
    > System.Data.Odbc.OdbcCommand
    > Protected WithEvents OdbcInsertCommand1 As
    > System.Data.Odbc.OdbcCommand
    > Protected WithEvents OdbcConnection1 As
    > System.Data.Odbc.OdbcConnection
    > Protected WithEvents OdbcDataAdapter1 As
    > System.Data.Odbc.OdbcDataAdapter
    > Protected WithEvents DataSet11 As TestWeb1.DataSet1
    > Protected WithEvents DataGrid1 As
    > System.Web.UI.WebControls.DataGrid
    >
    > 'NOTE: The following placeholder declaration is required by the Web
    > Form Designer.
    > 'Do not delete or move it.
    > Private designerPlaceholderDeclaration As System.Object
    >
    > Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles MyBase.Init
    > 'CODEGEN: This method call is required by the Web Form Designer
    > 'Do not modify it using the code editor.
    > InitializeComponent()
    > End Sub
    >
    > #End Region
    >
    > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles MyBase.Load
    > DataSet11.Clear()
    > OdbcDataAdapter1.Fill(DataSet11)
    > DataGrid1.DataBind()
    > End Sub
    >
    > End Class
    >
    >
    > iv been tryin to sort this for a couple of days but am completely at a
    > loss as to how to sort this. Can anyone help?
    >
    Christopher Reed, Feb 17, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hypo
    Replies:
    6
    Views:
    406
  2. Brendan Miller

    Web Forms VS Windows Forms

    Brendan Miller, Aug 11, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    5,071
    Kevin Spencer
    Aug 11, 2003
  3. =?Utf-8?B?ZGF2aWQ=?=

    embedded windows forms into web forms for control

    =?Utf-8?B?ZGF2aWQ=?=, Apr 7, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    5,207
    =?Utf-8?B?ZGF2aWQ=?=
    Apr 10, 2005
  4. Arsen V.
    Replies:
    7
    Views:
    825
  5. Eric
    Replies:
    2
    Views:
    481
Loading...

Share This Page