Click here to Skip to main content
15,902,939 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionhi Pin
anki121226-Apr-07 2:19
anki121226-Apr-07 2:19 
AnswerRe: hi Pin
leckey26-Apr-07 3:52
leckey26-Apr-07 3:52 
QuestionMy.Settings Pin
blackjack215026-Apr-07 2:13
blackjack215026-Apr-07 2:13 
AnswerRe: My.Settings Pin
kubben26-Apr-07 2:35
kubben26-Apr-07 2:35 
QuestionOCR Reading from pdf/image file type? Pin
.NetRams26-Apr-07 1:43
.NetRams26-Apr-07 1:43 
AnswerRe: OCR Reading from pdf/image file type? Pin
Christian Graus26-Apr-07 1:50
protectorChristian Graus26-Apr-07 1:50 
QuestionRe: OCR Reading from pdf/image file type? Pin
.NetRams26-Apr-07 2:45
.NetRams26-Apr-07 2:45 
Questionupdating a database Pin
peteyshrew26-Apr-07 1:39
peteyshrew26-Apr-07 1:39 
i'm trying to update a checkbox state from vb to an ms access database.

can anyone fix my code for me pleae?

it says "no value given for one or more parameters(what does this mean?).


Imports System.Data.OleDb

Public Class Block
Public conn As OleDbConnection
Public comm As OleDbCommand
Public dr As OleDbDataReader
Public da As OleDbDataAdapter
Dim icount As Integer
Private Sub Btnblock_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBlock.Click
'when the logon button is pressed



Dim ManagerLogin As String
'declares the variable

Try
conn = New OleDbConnection 'establishes that conn is a new connection
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\PCBank.mdb" 'the name of the connection (name of the database on the end)
conn.Open() 'opens the connection

comm = New OleDbCommand 'establishes that comm is a new command
comm.Connection = conn 'the connection for the command is the connection specified
comm.CommandType = CommandType.Text 'the commands are in text

ManagerLogin = "SELECT DISTINCT Password FROM Accounts WHERE ManagerID='" & Me.tbID.Text & "' "
'the variables value is an SQL command, selects value that is equal to the id AND password.

''MessageBox.Show(ManagerLogin) 'shows the sql command (only needed for testing)

comm.CommandText = ManagerLogin 'the variable is declared as a command
dr = comm.ExecuteReader 'gives the variable a value


conn = New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=PCBank.mdb")
conn.Open()
comm = New OleDbCommand("update into Accounts(Blocked) values('" & (chBlock.CheckState) & "')", conn)
icount = comm.ExecuteNonQuery()
MsgBox("record inserted")

chBlock.Checked = False

Catch ex As Exception
MsgBox(ex.Message)

If dr.Read() Then (it doesn't like this line either)'if the entry is correct (readable)
Me.Close()Confused | :confused:
Form2.Show() 'show the index varibale (form)
'close the current form

Else 'if the entry is incorrect
MessageBox.Show("Invalid ID, please try again") 'displays error message
tbID.Clear() 'clears the managerid


End If 'end if



End Try
conn.Close()
End Sub

Private Sub Block_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub
End Class
AnswerRe: updating a database Pin
Dave Sexton26-Apr-07 2:00
Dave Sexton26-Apr-07 2:00 
QuestionHi, Pin
saqibaba26-Apr-07 1:08
saqibaba26-Apr-07 1:08 
AnswerRe: Hi, Pin
Christian Graus26-Apr-07 1:47
protectorChristian Graus26-Apr-07 1:47 
Questionhow i can crop any image using avicap.dll or vb.net or wai Pin
saqibaba26-Apr-07 0:35
saqibaba26-Apr-07 0:35 
AnswerRe: how i can crop any image using avicap.dll or vb.net or wai Pin
Christian Graus26-Apr-07 0:53
protectorChristian Graus26-Apr-07 0:53 
Questionvoice command performer in vb.net Pin
sanket h modi26-Apr-07 0:16
sanket h modi26-Apr-07 0:16 
AnswerRe: voice command performer in vb.net Pin
Dave Kreskowiak26-Apr-07 4:55
mveDave Kreskowiak26-Apr-07 4:55 
Question[Message Deleted] Pin
PREMSONBABY25-Apr-07 22:50
PREMSONBABY25-Apr-07 22:50 
AnswerRe: Infopath Pin
Dave Kreskowiak26-Apr-07 4:56
mveDave Kreskowiak26-Apr-07 4:56 
QuestionHow to show more than one database collumns in a listbox Pin
keninfo25-Apr-07 22:26
keninfo25-Apr-07 22:26 
AnswerRe: How to show more than one database collumns in a listbox Pin
Tirthadip25-Apr-07 22:38
Tirthadip25-Apr-07 22:38 
AnswerRe: How to show more than one database collumns in a listbox Pin
CPallini25-Apr-07 22:43
mveCPallini25-Apr-07 22:43 
GeneralRe: How to show more than one database collumns in a listbox Pin
keninfo25-Apr-07 22:45
keninfo25-Apr-07 22:45 
GeneralRe: How to show more than one database collumns in a listbox Pin
keninfo25-Apr-07 23:28
keninfo25-Apr-07 23:28 
GeneralRe: How to show more than one database collumns in a listbox Pin
Tirthadip25-Apr-07 23:32
Tirthadip25-Apr-07 23:32 
GeneralRe: How to show more than one database collumns in a listbox Pin
CPallini25-Apr-07 23:37
mveCPallini25-Apr-07 23:37 
AnswerRe: How to show more than one database collumns in a listbox Pin
Tirthadip25-Apr-07 23:38
Tirthadip25-Apr-07 23:38 

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.