Connecting Tech Pros Worldwide Forums | Help | Site Map

connect to access with password

Newbie
 
Join Date: Oct 2008
Posts: 15
#1: Oct 14 '08
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's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,120
#2: Oct 14 '08

re: connect to access with password


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

Eg:
Expand|Select|Wrap|Line Numbers
  1. conString="Provider=Microsoft.Jet.OLEDB.4.0;Data " & _ 
  2. "Source=C:\Databases\mymusic.mdb; " & _
  3. "Jet OLEDB:System database=" & _
  4. "C:\Databases\system.mdw; " & _
  5. "User ID=UserX;Password=UserXPassword"
  6.  
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
Newbie
 
Join Date: Oct 2008
Posts: 15
#3: Oct 23 '08

re: connect to access with password


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.OutOfMemoryException 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.PageCount
grView.PageIndex = i
virTable.GridLines = grView.GridLines
If (Not (grView.HeaderRow) Is Nothing) Then
virTable.Rows.Add(grView.HeaderRow)
End If
For Each row As GridViewRow In grView.Rows
virTable.Rows.Add(row)
Next
If (Not (grView.FooterRow) Is Nothing) Then
virTable.Rows.Add(grView.FooterRow)
End If
Next
virTable.RenderControl(oHtmlTextWriter)
Response.Write(oStringWriter)
Response.End()
3. I tried like number 2 but i changed the position like :
For i = 1 To grView.PageCount
grView.PageIndex = i
virTable.GridLines = grView.GridLines
If (Not (grView.HeaderRow) Is Nothing) Then
virTable.Rows.Add(grView.HeaderRow)
End If
For Each row As GridViewRow In grView.Rows
virTable.Rows.Add(row)
Next
If (Not (grView.FooterRow) Is Nothing) Then
virTable.Rows.Add(grView.FooterRow)
End If
virTable.RenderControl(oHtmlTextWriter)
Response.Write(oStringWriter)
Next
Response.End()
But it gives an error message like number 1 : System.OutOfMemoryException Was Thrown
Reply