Jump to content
xisto Community
miCRoSCoPiC^eaRthLinG

VB.NET: MS-Access Interaction Tutorial (Part I)

Recommended Posts

VB.NET: MS-Access Interaction Tutorial (part 2)VB.NET: MS-Access Interaction Tutorial (Part I)

Hi

I'm working with vb.Net and msaccess project.

for login window, by using datareader I'm checking database data but the condition is checking only 1 record. To check full what is condition I hav to take

or by using oledbadaptor,how to write code to check the total records in database

 

-reply by Rahul

Share this post


Link to post
Share on other sites
vb.netVB.NET: MS-Access Interaction Tutorial (Part I)

WriteVB.Net program to search customer record using customer name or customer Id.Display customer record in Data Grid.

-reply by RANA

 

Share this post


Link to post
Share on other sites
Setup access connection to vb.netVB.NET: MS-Access Interaction Tutorial (Part I)
'Import the following libraries
 
Imports System.Data.OleDb
Imports System.Data
 
Public Class conf   'Class name
 Dim cn As OleDbConnection
 Dim dbconn As SqlConnection
 
 Public Function conDb()
 
     cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; DataSource=give the path to your acces databaseHere;")
     cn.Open()
     Return cn
 End Function
End Class
 
'Access your data using the followingCode
 
 Try
 
         sqlStr = "select * mas_user where email ='" &TxtUserID.Text & "' and password = '" & txtPwd.Text & "'"
                        'Define your query onHere
 
         Dim scmd As New OleDbCommand(sqlStr, con.ConDb)
         dr = scmd.ExecuteReader
 
         If dr.HasRows Then
             Me.Close()
         Else
             MsgBox("invalid User name or Password")
             Me.Close()
 
         End If
 
     Catch ex As Exception
         MsgBox(ex.ToString())
     End Try
 
-reply by menuka

 

Share this post


Link to post
Share on other sites
datagridVB.NET: MS-Access Interaction Tutorial (Part I)

I am using vb.Net 2008 I will link with ms access through vb.Net in application form I edit datagrid and some column I will also add a serch button so please help with me this program

Imports System.Data.OleDbPublic Class Form1   Dim cn As OleDbConnection   Dim cmd As OleDbCommand   Dim dr As OleDbDataReader   Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click   cn = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|mjk3.Accdb")   cn.Open()   cmd = New OleDbCommand("select * from table1", cn)   dr = cmd.ExecuteReader   While

  dr.Read() dr.Close()   cn.Close()   End SubEnd Class

-reply by jawad

 

Share this post


Link to post
Share on other sites
how i connect vb.net to datagridVB.NET: MS-Access Interaction Tutorial (Part I)

 

 itride this code but it is have error

mports System.Data.OleDb

Public Class Form1   Dim cn As OleDbConnection   Dim cmd As OleDbCommand   Dim dr As OleDbDataReader   Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click   cn = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|mjk3.Accdb")   cn.Open()   cmd = New OleDbCommand("select * from table1", cn)   dr = cmd.ExecuteReader   While

  dr.Read() dr.Close()   cn.Close()   End SubEnd Class

-reply by jawad

 

-reply by masarat

Share this post


Link to post
Share on other sites
how to use access len function in VB.NET?VB.NET: MS-Access Interaction Tutorial (Part I)

hii I want to use this query in VB.NET, but I m getting error to use 'len' functio

it works in access

 

select  len([EMPNAME]& [DESIGNATION] &[ADDRESS])-len(replace([EMPNAME] &[DESIGNATION]&[ADDRESS],"a","")) as TOTNAme

 from tbEmp

 

can u give me solution?

-reply by keyur

Share this post


Link to post
Share on other sites
It says that database is not recnogized?VB.NET: MS-Access Interaction Tutorial (Part I)

Look, I tried to connect vb 2010 and access 2007 database with your code. But when I start the program it says that database is not recnogized!If I take databaze made in access XP, and change the code to open it, it works fine... Do you know what it is?

Thanx-reply by denzel

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.