Click here to Skip to main content
15,921,716 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: add Pin
User 171649231-Jul-06 4:43
professionalUser 171649231-Jul-06 4:43 
GeneralRe: add Pin
kyosugi31-Jul-06 6:05
kyosugi31-Jul-06 6:05 
GeneralRe: add Pin
Kevin McFarlane31-Jul-06 6:17
Kevin McFarlane31-Jul-06 6:17 
GeneralRe: add Pin
User 171649231-Jul-06 14:23
professionalUser 171649231-Jul-06 14:23 
GeneralRe: add Pin
kyosugi31-Jul-06 21:30
kyosugi31-Jul-06 21:30 
QuestionDatabases [modified] Pin
Nolin31-Jul-06 3:50
Nolin31-Jul-06 3:50 
AnswerRe: Databases Pin
Tyquaun Hunter31-Jul-06 9:28
Tyquaun Hunter31-Jul-06 9:28 
GeneralRe: Databases Pin
Werries31-Jul-06 11:35
Werries31-Jul-06 11:35 
Hi there.

If you use an Access database here is an example on how to use it.

First add a reference to ADODB.dll

Declare database connection varaible as follow:

Private cnDatabase As ADODB.Connection

Open the database. Note that the DatabaseName must be the full path of the database.

cnDatabase = New ADODB.Connection
cnDatabase.Open(DatabaseName)

Fetch data from the Database:

Dim rsRecord As New ADODB.Recordset
Dim strSql As String
Dim tempValue As Object

strSql = "SELECT * FROM " & TableName

rsRecord.Open(strSql, cnDatabase)

With rsRecord
If Not .EOF Then
tempValue = .Fields("FieldName").Value
End If

.Close()
End With

rsRecord = Nothing

Save data to the database:

Dim rsRecord As New ADODB.Recordset
Dim strSql As String

strSql = "SELECT * FROM " & TableName

rsRecord.Open(strSql, cnDatabase, ADODB.CursorTypeEnum.adOpenKeyset,
ADODB.LockTypeEnum.adLockOptimistic)

With rsRecord
.AddNew()

.Fields("FieldName").Value = YourValue

.Update()

.Close()
End With

rsRecord = Nothing


Hope this wil help you.

A programmer's life is good... or is it?? Ek dink nie so nie!

QuestionReturn String from C to VB Pin
MohammadAmiry31-Jul-06 3:33
MohammadAmiry31-Jul-06 3:33 
QuestionComboBox MouseMove Pin
tibmark31-Jul-06 2:56
tibmark31-Jul-06 2:56 
AnswerRe: ComboBox MouseMove Pin
Tyquaun Hunter31-Jul-06 9:30
Tyquaun Hunter31-Jul-06 9:30 
GeneralRe: ComboBox MouseMove Pin
tibmark31-Jul-06 12:05
tibmark31-Jul-06 12:05 
QuestionOrgnisional structure [modified] Pin
Sinchan Nikam31-Jul-06 2:07
Sinchan Nikam31-Jul-06 2:07 
QuestionReturn Parameter in ADO.NET Pin
Carlos Paiva31-Jul-06 2:02
Carlos Paiva31-Jul-06 2:02 
AnswerRe: Return Parameter in ADO.NET Pin
Carlos Paiva31-Jul-06 3:12
Carlos Paiva31-Jul-06 3:12 
AnswerRe: Return Parameter in ADO.NET Pin
akchandru31-Jul-06 5:23
akchandru31-Jul-06 5:23 
QuestionFind Function? [modified] Pin
Harold_Wishes31-Jul-06 1:33
Harold_Wishes31-Jul-06 1:33 
AnswerRe: Find Function? Pin
Tyquaun Hunter31-Jul-06 7:00
Tyquaun Hunter31-Jul-06 7:00 
GeneralRe: Find Function? Pin
Harold_Wishes31-Jul-06 7:30
Harold_Wishes31-Jul-06 7:30 
GeneralRe: Find Function? [modified] Pin
Tyquaun Hunter31-Jul-06 9:27
Tyquaun Hunter31-Jul-06 9:27 
Questionjavasript problem using vb.net Pin
jimsharma31-Jul-06 1:16
jimsharma31-Jul-06 1:16 
AnswerRe: javasript problem using vb.net Pin
Guffa31-Jul-06 3:02
Guffa31-Jul-06 3:02 
Questionhow to check the check box programatically in vb..? Pin
Ron.S31-Jul-06 0:51
Ron.S31-Jul-06 0:51 
AnswerRe: how to check the check box programatically in vb..? [modified] Pin
TDSp31-Jul-06 1:14
TDSp31-Jul-06 1:14 
AnswerRe: how to check the check box programatically in vb..? Pin
Nouvand3-Aug-06 2:20
Nouvand3-Aug-06 2:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.