Jump to content

rdmusn2005

Members
  • Posts

    7
  • Joined

  • Last visited

rdmusn2005's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Nevermind good folk......I'm an idiot. I overlooked one simple step I forgot to move to the next item in the object. WeekObj.MoveNext() I think its time for more than 4 hours of sleep.
  2. Ok, next issue. I've studied the parameters for the DISTINCT tab. Forums, help, etc. I know that the DISTINCT value returns a single entry for a column of data. For instance, if you have 15 entries in the Week column, but 8 are Week 1, and 7 are week 2.... it should return a single value of Week 1 and Week 2. Here is there problem: Code: 'Now, we create the LARGE data_table of content from the other database for this rate. Set WeekObj = Server.CreateObject("ADODB.Recordset") SQLQuery = "SELECT DISTINCT WeekID FROM IC_Course WHERE DayID <= 6" response.write(SQLQuery) 'Set WeekObj = CourseConn.Execute(SQLQuery) WeekObj.Open SQLQuery, CourseConn,1,1 If Not WeekObj.EOF Then Dim RC RC = WeekObj.Recordcount Do While RC > 0 Response.Write("<br>Weeks Returned:<br>") Response.Write(WeekObj.Fields("WeekID").Value) Response.Write("<br>") RC = RC - 1 Loop Else Response.Write("No Data Returned.") End If I should be getting this: Weeks Returned: 1 2 Instead, I get: Weeks Returned: 1 Weeks Returned: 1 It repeats just week 1. Have I formatted the loop wrong?
  3. Couldnt find the answer there. Switched the column type from Yes / No to a binary value; 1 for true, 0 for false. Made the adjustments and now it work fine. Still stumped how come one works and the other does not. FYI, line 13 was the actual SELECT statement. So that's why I was stumped.
  4. Ok, code sample #1: Officer = Session("MemberName") Set MyMSGs = Server.CreateObject("ADODB.Recordset") SQLQuery = "SELECT * FROM QuickChat WHERE Officer = "& Officer &" AND Read <> Yes" Set MyMSGs = Conn.Execute(SQLQuery) Error MSG: error '80004005' /va/main2.asp, line 13 *now I know this is a generic error, but...here is the bigger issue" Sample #2: DTS = Date() Set GuildEvents = Server.CreateObject("ADODB.Recordset") SQLQuery = "SELECT * FROM EVENTS WHERE EventDate >= '"& DTS &"' ORDER BY EventDate" Set GuildEvents = Conn.Execute(SQLQuery) No error on the page THIS query is run on. Now, it is two different pages. The first one simly returns all messages stored for the person logging in. The second lists events that have not expired. Sample 1, errors out. Sample 2, works perfectly. Both use the same cnnection string object along with the rest of the mockup site. So I know that isnt it. Tables are fine. SQL works within the SQL query wizards and scripts insid the database. I cant for the lif of me figure out why one page works, and another does not. I really need help with this. I've googled everything, includee the useless search for th error code. Nothing about permissions or syntax works. So, I'm stumped.
  5. Ok, code sample #1: Officer = Session("MemberName") Set MyMSGs = Server.CreateObject("ADODB.Recordset") SQLQuery = "SELECT * FROM QuickChat WHERE Officer = "& Officer &" AND Read <> Yes" Set MyMSGs = Conn.Execute(SQLQuery) Error MSG: error '80004005' /va/main2.asp, line 13 *now I know this is a generic error, but...here is the bigger issue" Sample #2: DTS = Date() Set GuildEvents = Server.CreateObject("ADODB.Recordset") SQLQuery = "SELECT * FROM EVENTS WHERE EventDate >= '"& DTS &"' ORDER BY EventDate" Set GuildEvents = Conn.Execute(SQLQuery) No error on the page THIS query is run on. Now, it is two different pages. The first one simly returns all messages stored for the person logging in. The second lists events that have not expired. Sample 1, errors out. Sample 2, works perfectly. Both use the same cnnection string object along with the rest of the mockup site. So I know that isnt it. Tables are fine. SQL works within the SQL query wizards and scripts insid the database. I cant for the lif of me figure out why one page works, and another does not. I really need help with this. I've googled everything, includee the useless search for th error code. Nothing about permissions or syntax works. So, I'm stumped.
  6. I figured that issue out. I was querying short date but I had faile to set short date n the table. So I was getting date and time (having stored Now() as the date sent in the form that made the record. Once I fixed that, everything was working. Thanks for the post tho.
  7. Help. The block of code that is giving me fits. DTS = Date() - 7 DTS = FormatDateTime(DTS, 2) Set GuildEvents = Server.CreateObject("ADODB.Recordset") SQLQuery = "SELECT * FROM EVENTS WHERE EventDate > '"& DTS &"' ORDER BY EventDate" Set GuildEvents = Conn.Execute(SQLQuery) This is not working. For some reason, I am getting the following error: Microsoft Office Access Database Engine error '80040e07' Data type mismatch in criteria expression. /va/calendar.asp, line 10 Now, my understanding is because the database stored the data in the EventDate as Date/Time. But I used Short Date for the type (using MS Access). Can't figure out why the mismatch. Help please.
×
×
  • Create New...