connect to access with password

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ulai
    New Member
    • Oct 2008
    • 15

    connect to access with password

    this access file has password when you want to opened it.
    After that it run the form login that had user field and password field.

    How to connected to that access file using asp.net with language vb.net
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    You need to provide user credentials to connect to your Access Database in your Connection String.

    Eg:
    Code:
    conString="Provider=Microsoft.Jet.OLEDB.4.0;Data " & _ 
    "Source=C:\Databases\mymusic.mdb; " & _
    "Jet OLEDB:System database=" & _
    "C:\Databases\system.mdw; " & _
    "User ID=UserX;Password=UserXPassword"
    See this article on Accessing Microsoft Office Data from .NET Applications and this walkthrough on Editing an Access Database with ADO.NET for more information.

    -Frinny

    Comment

    • ulai
      New Member
      • Oct 2008
      • 15

      #3
      Thanks for your help. It really help to solve my work.
      But now i have a bigger problem :
      I had more than 65535 records in gridview divide by 10/pages. And when i tried to export the gridview in excel on every way :
      1. I disabled the allowpaging in gridview and got and error messages like : System.OutOfMem oryException Was Thrown
      2. My idea is to store row in gridview to virtable per pages. I create virtable as Table. Added row to virtable from gridview/page. But its only displayed the first page of gridview. Here is the code:
      For i = 1 To grView.PageCoun t
      grView.PageInde x = i
      virTable.GridLi nes = grView.GridLine s
      If (Not (grView.HeaderR ow) Is Nothing) Then
      virTable.Rows.A dd(grView.Heade rRow)
      End If
      For Each row As GridViewRow In grView.Rows
      virTable.Rows.A dd(row)
      Next
      If (Not (grView.FooterR ow) Is Nothing) Then
      virTable.Rows.A dd(grView.Foote rRow)
      End If
      Next
      virTable.Render Control(oHtmlTe xtWriter)
      Response.Write( oStringWriter)
      Response.End()
      3. I tried like number 2 but i changed the position like :
      For i = 1 To grView.PageCoun t
      grView.PageInde x = i
      virTable.GridLi nes = grView.GridLine s
      If (Not (grView.HeaderR ow) Is Nothing) Then
      virTable.Rows.A dd(grView.Heade rRow)
      End If
      For Each row As GridViewRow In grView.Rows
      virTable.Rows.A dd(row)
      Next
      If (Not (grView.FooterR ow) Is Nothing) Then
      virTable.Rows.A dd(grView.Foote rRow)
      End If
      virTable.Render Control(oHtmlTe xtWriter)
      Response.Write( oStringWriter)
      Next
      Response.End()
      But it gives an error message like number 1 : System.OutOfMem oryException Was Thrown

      Comment

      Working...