473,546 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System.Data.Ole Db.OleDbExcepti on: Syntax error

(Type your message here)

--------------------------------
From: dim mzeura

I have the same problem too. Please help!

System.Data.Ole Db.OleDbExcepti on: Syntax error (missing operator) in query expression ''\\crwfs1\proj ects12\AP-Wilbur\Analysis _NonQuantitativ e\Damages_Repor t\Backup_Exhibi ts_Leitzinger's _Damages_Calcul ations', '328424' )'.

-----Here is my code----
<html><head>
<title>Director y Information</title>
<%@ Page Language="vb" debug="true"%>
<%@ Import Namespace="Syst em.IO" %>
<%@ Import Namespace="Syst em.Data" %>
<%@ Import Namespace="Syst em.Data.OleDB" %>
<script runat="server">

dim intTotalDirSize as Long

Sub Page_Load(sende r as object, e as EventArgs)

dim strRootDir as string = "\\crwfs1\proje cts12" 'Form variable or add the physical path of your directory here
Response.write (" <b>Directorie s in</b> " & strRootDir & "<hr> <br>") 'List the files in the root directory
ListFiles(strRo otDir)
ListDirs(strRoo tDir, strRootDir) 'List subdirectories and their files
end sub

Sub ListDirs(strCur rentDir as string, strRootDir as string)
dim strDir as string
dim arrSubdirs() as string
arrSubdirs = Directory.GetDi rectories(strCu rrentDir)

for each strDir in arrSubdirs
ListFiles(strDi r)
ListDirs(strDir , strCurrentDir) 'Recursively call each subdirectory

next
end sub

Sub ListFiles(strCu rrentDir as string)

Dim dir as DirectoryInfo
dir = new DirectoryInfo(s trCurrentDir)
Dim arrFiles as Array = dir.GetFiles()
Dim strFile as FileInfo
dim intDirsize as Long

For each strFile in arrFiles

'response.write ( "&nbsp;&nbsp;&n bsp;&nbsp;" & strFile.Name)
'response.write ( "&nbsp;&nbs p;" & strFile.Length & " bytes <br>")
intDirSize += strFile.length
next

Dim conNorthwind as OleDBConnection
Dim strInsert As String
Dim strInsert2 As String
Dim cmdInsert As OleDbCommand
Dim cmdInsert2 As OleDbCommand

conNorthwind = New OleDBConnection ("PROVIDER=Micr osoft.Jet.OLEDB .4.0;DATA Source=" & server.MapPath( "db.mdb"))

strInsert = "Insert INTO Dir ( Directory,Sze ) VALUES ( '" & strCurrentDir & "', '" & intDirSize & "' )"
cmdInsert = New OleDBCommand ( strInsert, conNorthwind )
conNorthwind.Op en()
cmdInsert.Execu teNonQuery()
conNorthwind.Cl ose()
intTotalDirSize += intDirSize
end Sub
</script>
</head>
</html>
---------End of Code--------------

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>NgMJZ2Z1n0G zljCVvaX0HA==</Id>
Nov 20 '05 #1
0 2924

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5409
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 system.data.dll Any suggestions what could be wrong.
0
5270
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 information from an Access database. It worked fine when I ran on my computer. I use a parameterized query to retrieve some customer specific...
1
6827
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 itself (asp.net recycled?); it also can be solved by restarting IIS. Any ideas what cause(s) this to happen? System.Data.OleDb.OleDbException:...
2
2835
by: Joe | last post by:
Hello All, I am trying to insert a record in the MS Access DB and for some reason I cannot get rid of error message, System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement. And the line it shows in red is cmd.ExecuteNonQuery()
0
2746
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 some information from an Access database. It worked fine when I ran on my home computer. I use a datagrid witha a dataset and a parameterized query...
3
8816
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 don't think I made any changes to either page other than changing the user control that creates the header). Server Error in '/myApp' Application....
0
5629
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 System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String srcTable) at System.Data.Common.DbDataAdapter.Update(DataSet dataSet) at...
5
9633
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 this error? Oracle error occurred, but error message could not be retrieved from Oracle. Description: An unhandled exception occurred during the...
1
5392
by: Joe | last post by:
Hello All, I am trying to insert a record in the MS Access DB and for some reason I cannot get rid of error message, System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement. And the line it shows in red is cmd.ExecuteNonQuery()
0
7504
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7694
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7947
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7792
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6026
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5080
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3491
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1921
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.