Hi Dominique,
I get error "An unhandled exception of type
'System.Data.Ol eDb.OleDbExcept ion' occurred in system.data.dll " at
conn.open()
what can i do?
Regards,
wim
Imports System.Data.Ole Db
Public Class Form1
Inherits System.Windows. Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeCompo nent()
'Add any initialization after the InitializeCompo nent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Disp ose()
End If
End If
MyBase.Dispose( disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub InitializeCompo nent()
'
'Form1
'
Me.AutoScaleBas eSize = New System.Drawing. Size(5, 13)
Me.ClientSize = New System.Drawing. Size(292, 266)
Me.Name = "Form1"
Me.Text = "Form1"
End Sub
#End Region
Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim conn As New
OleDbConnection ("Provider=Micr osoft.Jet.OLEDB .4.0;DataSource =C:\backup
Compaq MV500\TAGS\Acce ss\2003.mdb")
conn.Open()
Dim cmd As OleDbCommand = conn.CreateComm and()
cmd.CommandType = CommandType.Sto redProcedure
cmd.CommandText = "select * from import"
End Sub
End Class
"Wim" <wi***********@ pandora.be> schreef in bericht
news:oO******** *************@p hobos.telenet-ops.be...
ok ,thanks a lot
wim
"Dominique Vandensteen" <domi.vds_inser t@tralala_tenfo rce.com> schreef in
bericht news:ud******** *****@TK2MSFTNG P11.phx.gbl... you can do something alike stored procedures with access (queries)
but I don't know if you can create them from vb.net code
to call them:
dim conn as New OleDbConnection ("Provider=Micr osoft.Jet.OLEDB .4.0;Data
Source=C:\backu p Compaq MV500\TAGS\Acce ss\2003.mdb;")
conn.Open()
Dim cmd As OleDbCommand = conn.CreateComm and()
cmd.CommandType = CommandType.Sto redProcedure
cmd.CommandText = "myquery"
Dominique
"Wim" <wi***********@ pandora.be> wrote in message
news:Ie******** *************@p hobos.telenet-ops.be... No I don't want to put data in the table...
only put a new query in the access database and use it later..
So you think this is impossible??
Regards
wim
ominique Vandensteen" <domi.vds_inser t@tralala_tenfo rce.com> schreef
in bericht news:Oq******** ******@TK2MSFTN GP11.phx.gbl...
> do you want to put your query as data in a table?
> if so see code
> if put it in access as a stored procedure then no can do...
>
>
>
> Imports System.Data.Ole Db
>
>
> dim conn as New
OleDbConnection ("Provider=Micr osoft.Jet.OLEDB .4.0;Data > Source=C:\backu p Compaq MV500\TAGS\Acce ss\2003.mdb;")
> conn.Open()
> Dim cmd As SqlCommand = conn.CreateComm and()
> cmd.CommandText = "insert into mytable (columnname) values ('the
query...')"
> cmd.ExecuteNonQ uery()
> conn.Close()
>
>
> Dominique
>
>
> "Wim" <wi***********@ pandora.be> wrote in message
> news:6_******** *************@p hobos.telenet-ops.be...
> > the access database is located at
> > "C:\backup Compaq MV500\TAGS\Acce ss\2003.mdb"
> >
> > "Wim" <wi***********@ pandora.be> schreef in bericht
> > news:fB******** ************@ph obos.telenet-ops.be...
> > > Hi,
> > >
> > > I would like to make and put a query in my database by VB.NET code. > > >
> > > Is this possible?
> > >
> > > Thanks for your help,
> > >
> > > wim
> > >
> > >
> >
> >
>
>