Click here to Skip to main content
16,016,789 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralCallback function Pin
Tomaz Rotovnik4-Jan-05 3:26
Tomaz Rotovnik4-Jan-05 3:26 
GeneralRe: Callback function Pin
OICU8125-Jan-05 18:19
OICU8125-Jan-05 18:19 
GeneralRe: Callback function Pin
Tomaz Rotovnik5-Jan-05 20:03
Tomaz Rotovnik5-Jan-05 20:03 
GeneralRe: Callback function Pin
OICU8125-Jan-05 20:47
OICU8125-Jan-05 20:47 
Generaltextboxes to datagrid Pin
Makniteasy3-Jan-05 23:25
Makniteasy3-Jan-05 23:25 
GeneralRe: textboxes to datagrid Pin
Ritesh12344-Jan-05 3:53
Ritesh12344-Jan-05 3:53 
GeneralRe: textboxes to datagrid Pin
Makniteasy4-Jan-05 8:51
Makniteasy4-Jan-05 8:51 
Generaloledb error Pin
GaryKoh3-Jan-05 21:17
GaryKoh3-Jan-05 21:17 
hello
i have build a database using MS ACCESS and write a coding in VB.NET to connect it as below

Imports System.Data.OleDb<br />
<br />
Public Class addItem<br />
    Inherits System.Windows.Forms.Form<br />
    Dim myconnection As New OleDbConnection("provider=microsoft.jet.oledb.4.0; datasource = Application.ExecutablePath + \LibrarySystem.mdb")<br />
<br />
Private Sub saveB_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles saveB.Click<br />
        myconnection.Open()<br />
        Dim mycom As New OleDbCommand("INSERT INTO Product(product_code) VALUES ('" & productTb.Text & "')", myconnection)<br />
        Dim MyReader As OleDbDataReader = mycom.ExecuteReader()<br />
        mycom.ExecuteNonQuery()<br />
        myconnection.Close()<br />
        MyReader.Close()<br />
        mycom.Dispose()<br />
    End Sub


but when i click on the saveB button, the error below show up
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll

which point to
myconnection.Open()

may i know what i did wrong?
thank you in advance


Gary
GeneralRe: oledb error Pin
Dave Kreskowiak4-Jan-05 5:56
mveDave Kreskowiak4-Jan-05 5:56 
GeneralAdding image to listview Pin
kobezt083-Jan-05 20:47
kobezt083-Jan-05 20:47 
QuestionADO and MySql Database in VB6 ? Pin
paykani3-Jan-05 20:12
paykani3-Jan-05 20:12 
AnswerRe: ADO and MySql Database in VB6 ? Pin
Roger Wright4-Jan-05 4:56
professionalRoger Wright4-Jan-05 4:56 
Generalrichtextbox askin for help Pin
Mohammad Daba'an3-Jan-05 20:07
Mohammad Daba'an3-Jan-05 20:07 
GeneralSecurity Pin
lafser633-Jan-05 15:19
lafser633-Jan-05 15:19 
GeneralRe: Security Pin
Dave Kreskowiak4-Jan-05 5:47
mveDave Kreskowiak4-Jan-05 5:47 
Generalimage property Pin
Fantasca3-Jan-05 13:15
Fantasca3-Jan-05 13:15 
GeneralRe: image property Pin
Tom John3-Jan-05 23:42
Tom John3-Jan-05 23:42 
GeneralRe: image property Pin
Fantasca4-Jan-05 0:08
Fantasca4-Jan-05 0:08 
GeneralDatePicker default value Pin
bexarcounty3-Jan-05 12:00
bexarcounty3-Jan-05 12:00 
GeneralMouse_Hover Event Pin
azam3163-Jan-05 9:52
azam3163-Jan-05 9:52 
Questionhow to compare two images ? Pin
3-Jan-05 8:31
suss3-Jan-05 8:31 
Questionhow I read bmp's pixel? Pin
Mars9993-Jan-05 7:51
Mars9993-Jan-05 7:51 
Generalneed help Pin
RygleD3-Jan-05 6:44
RygleD3-Jan-05 6:44 
GeneralWindows Clipboard Pin
Damian Castroviejo3-Jan-05 5:55
Damian Castroviejo3-Jan-05 5:55 
GeneralAccess to T-SQL Pin
edd1em3-Jan-05 4:53
edd1em3-Jan-05 4:53 

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.