473,320 Members | 2,052 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.

Errors Reading excel file

Hi there, first time poster...long time lurker ;-)

Not sure why but I get errors when I add the 'where' clause to my select statement. Any ideads why this is happening - been researching for hours...

here's a snippet of the code:

Expand|Select|Wrap|Line Numbers
  1. oNoun = Request.Form("noun")
  2. response.Write(oNoun)
  3.  
  4. strSelect = "Select modifier from [sheet1$] "
  5. 'strSelect = strSelect & " where noun = " & oNoun
  6.  
  7.  
  8. Set oConnDICT = Server.CreateObject("ADODB.Connection")
  9. oConnDICT.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
  10.                "Data Source=" & Session("dict_full_path_name") & ";" & _
  11.                "Extended Properties=""Excel 8.0;HDR=YES;"""
  12. Dim oRSDICT
  13. Set oRSDICT = Server.CreateObject("ADODB.Recordset")
  14. oRSDICT.Open strSelect, oConnDICT
  15.  
  16. If Not oRSDICT.EOF then
  17.     arroRSDICT = oRSDICT.GetRows()
  18. End If
  19.  
Jan 17 '09 #1
2 1446
jhardman
3,406 Expert 2GB
Just an observation, you have written the query as if the noun column contains a number. If that is correct, then it should work. If the noun column should contain other data, a string for example, then the clause should end as follows:
Expand|Select|Wrap|Line Numbers
  1. strSelect = strSelect & " where noun = '" & oNoun & "'"
Let me know if this helps.

Jared
Jan 19 '09 #2
You are exactly correct Jared. I found it about two minutes after I posted my question and forgot to update the thread.

Thanx for taking the time.
Jan 19 '09 #3

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

Similar topics

0
by: David Alliet | last post by:
Hello, I'm having a bit of a problem with ASP and Excel. A client has developed his own program, which calculates alot of financial stuff, in excel. I'm doing his websites and he has requested...
1
by: mail2atulmehta | last post by:
Hi, I do not know if this is right place for this, but i need some help. I have a text file, whose values are seprated by a delimiter. I want to open this file in excel, ( not import it) . I have...
1
by: Turner, GS \(Geoff\) | last post by:
> -----Original Message----- > From: siliconwafer > Posted At: 19 August 2005 15:20 > Posted To: c > Conversation: reading an excel file in C? > Subject: reading an excel file in C? > > >...
4
by: Phoebe. | last post by:
Hi, Good Day! Reading 1 excel file into a dataset is fine. How can I read multiple excel with the same data structure into 1 dataset? How can I append those data? Can someone help? Thanks in...
5
by: Scott M. Lyon | last post by:
I've just discovered a bug in some code I wrote a little while ago, and I need you guys' help to fix it. My program imports data from a standard Excel Spreadsheet (just with specific column...
9
by: dba123 | last post by:
I need some help and direction on what classes and an example or two (article) on how to read an Excel Worksheet and insert one column into a database table column. I am using .NET 2.0 only. What...
3
by: Brad | last post by:
I'm having a problem reading data from an Excel file into a dataset. Can anybody give me an idea of what's happening? I've included the problematic source and the error message to the end of this...
2
by: Manikandan | last post by:
Hi, I have a program written in .Net Framework 1.1 using Visual studio enterprise edition 2003. I tried compiling the same program in visual c# express edition 2005. I'm getting following...
1
by: sachinkale123 | last post by:
Hi, I am reading excel file and reading values from that I am using provider As : "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = " + Filename + ";Extended Properties=\"Excel 8.0;Hdr=No;IMEX=1\"";...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll 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...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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: 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...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.