RE:conexion de base de datos
esto para una db access para sql solo se cambia el oledb sql y la connectionstring
Dim strQry As String
Dim cN As New OleDb.OleDbConnection
Dim oCGen As New OleDb.OleDbCommand
cN.ConnectionString = "Data Source= c:\carpeta\basededatos.mdb; " & _
' Provider = Microsoft.jet.OleDB.4.0;"
cN.Open()
strQry = "SELECT * FROM CATUSU WHERE USUARIO = '" & Trim(txtUsuario.Text) & "' AND USUSTA = 1"
oCGen.CommandText = strQry
oCGen.Connection = cN
oCGen.CommandType = CommandType.Text
Dim oDGen As OleDb.OleDbDataReader = oCGen.ExecuteReader
If oDGen.Read = False Then
'codigo
else
'codigo
endif
cn.close()