473,320 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

oleDb.OleDBException error

3
I get an error meessage and a crash on my OleDbDataAdapter from the following code trying to call up record meeting a simple date criteria. What am I doing wrong. Been on this problem for a week now. Thanks

Dim DBConnect As OleDb.OleDbConnection
Dim DBAdapt As OleDb.OleDbDataAdapter
Dim SQLstatement As String
Dim txtvalue As Date
Dim MyDataReader As OleDbDataReader
Dim MyCommand As New OleDbCommand(SQLstatement, DBConnect)
Dim Ds As New DataSet

txtvalue = #9/1/2006#
DBConnect = New OleDb.OleDbConnection("provider=microsoft.Jet.OLED B.4.0; Data Source=C:\vatrix\DataSampe\SampData.mdb")
DBConnect.Open()
SQLstatement = "select * from SampData WHERE DateField = #" & txtvalue.ToShortDateString & "#"
DBAdapt = New OleDbDataAdapter(SQLstatement, DBConnect)
DBCommand = New OleDb.OleDbCommand(SQLstatement, DBConnect)
DBAdapt.Fill(Ds, "SampData")
DBConnect.Close()
DataGrid1.DataSource = DBDataSet
With DataGrid1
DataGrid1.Refresh()
.CaptionText = "data"
.AllowSorting = True
.AlternatingBackColor = System.Drawing.Color.Bisque
.SetDataBinding(Ds, "SampData")
End With

End Sub
Sep 27 '06 #1
0 1095

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: aacool | last post by:
Hi, I've been trying to open an Excel connection through OLEDB with the code below: string ConnectString =@"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + fileName.Text +...
3
by: G.Esmeijer | last post by:
Friends, The following code works fin. BUT... after a >> couple times<< this code is used is a class it comes with an error saying unhandled System.Data.OleDb.OleDbException' occurred in...
0
by: silesius | last post by:
I've been using VS 2003 to develop a webapplication using C#. Today I exported the application to a remote webserver I begun experiencing problems. It's a simple application that retrieves some...
1
by: T8 | last post by:
I have a asp.net (framework 1.1) site interfacing against SQL 2000. It runs like a charm 99% of the time but once in a while I get the following "unspecified error". Sometimes it would resolve by...
0
by: silesius | last post by:
I've been using VS.NET 2003 to develop a webapplication using C#. Today I exported the application to another webserver I begun experiencing problems. It's a simple application that retrieves...
3
by: Brian Foree | last post by:
I am developing an ASP.NET application that uses Access 2000 as its backend, and have just started getting the following error on 2 ASP.NET pages that had been working until late last week (and I...
0
by: NicK chlam via DotNetMonster.com | last post by:
this is the error i get System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement. at System.Data.Common.DbDataAdapter.Update(DataRow dataRows, DataTableMapping tableMapping) at...
5
by: petro | last post by:
Hello all, My asp.net web application works on my machine but I get the following error on our test web server, There is only one oracle home on the test server. Does anyone know how to resolve...
6
by: Learner | last post by:
Hi there, I am trying to access the access database sitting at OleDbConnection oleConn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Program Files\\Microsoft Visual...
0
by: John G | last post by:
I have been using Oracle Helper to connect to my oracle 9i Db. When excute text it works fine, but when I try to execute a store procedure I get the following error message. I searched...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shllpp 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.