N
Neo Geshel
I have the two subs:
Sub UniqueHits()
Dim StrSQLQuery As String
Dim ObjAdapter as New OleDbDataAdapter()
Dim ObjDataSet as DataSet
StrSQLQuery = "SELECT * FROM Browser WHERE IsUnique = True"
ObjAdapter.SelectCommand = new OleDbCommand(StrSQLQuery,
ObjConnection)
ObjDataSet = new DataSet()
ObjAdapter.Fill(ObjDataSet,"hits")
Dim RcdCount as Integer
RcdCount = ObjDataSet.Tables("hits").Rows.Count.ToString()
UniqueHitCount.Text = "There have been " & RcdCount & " unique
visitors to your site."
End Sub
Sub TotalHitsGetMetz()
Dim StrSQLQuery As String
Dim ObjAdapter as New OleDbDataAdapter()
Dim ObjDataSet as DataSet
StrSQLQuery = "SELECT * FROM Browser WHERE Domain = 'domain.com'"
ObjAdapter.SelectCommand = new OleDbCommand(StrSQLQuery,
ObjConnection)
ObjDataSet = new DataSet()
ObjAdapter.Fill(ObjDataSet,"hits")
Dim RcdCount as Integer
RcdCount = ObjDataSet.Tables("hits").Rows.Count.ToString()
TotalHitCountGetMetz.Text = "GetMetz has been accessed " & RcdCount &
" times."
End Sub
The first one works perfectly. However, the second throws the following
error message:
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException:
IErrorInfo.GetDescription failed with E_FAIL(0x80004005).
Source Error:
Line 40: ObjAdapter.Fill(ObjDataSet,"hits")
What gives?? The code between the two are identical. There is no logical
difference between the two, and yet the second throws the error. I know
this, because removing the "WHERE Domain = 'domain.com'" makes it work
again. Problem is, my client uses up to 4 different domain names for his
web site, and I want to count the hits for each domain name.
IsUnique is a binary (yes/no) variable in the DB, and Domain is a
string. This is an Access db. Removing the single quotes from around the
Domain value makes no difference.
TIA to everyone that helps this poor sod.
....Geshel
--
************************************************************************
Reply-to e-mail forwards all received e-mails to SpamCop for UBE/UCE
(Unsolicited Bulk/Commercial E-mail) reporting. DO NOT USE THAT ADDRESS!
Please send e-mail to my first name at my last name dot org.
************************************************************************
Sub UniqueHits()
Dim StrSQLQuery As String
Dim ObjAdapter as New OleDbDataAdapter()
Dim ObjDataSet as DataSet
StrSQLQuery = "SELECT * FROM Browser WHERE IsUnique = True"
ObjAdapter.SelectCommand = new OleDbCommand(StrSQLQuery,
ObjConnection)
ObjDataSet = new DataSet()
ObjAdapter.Fill(ObjDataSet,"hits")
Dim RcdCount as Integer
RcdCount = ObjDataSet.Tables("hits").Rows.Count.ToString()
UniqueHitCount.Text = "There have been " & RcdCount & " unique
visitors to your site."
End Sub
Sub TotalHitsGetMetz()
Dim StrSQLQuery As String
Dim ObjAdapter as New OleDbDataAdapter()
Dim ObjDataSet as DataSet
StrSQLQuery = "SELECT * FROM Browser WHERE Domain = 'domain.com'"
ObjAdapter.SelectCommand = new OleDbCommand(StrSQLQuery,
ObjConnection)
ObjDataSet = new DataSet()
ObjAdapter.Fill(ObjDataSet,"hits")
Dim RcdCount as Integer
RcdCount = ObjDataSet.Tables("hits").Rows.Count.ToString()
TotalHitCountGetMetz.Text = "GetMetz has been accessed " & RcdCount &
" times."
End Sub
The first one works perfectly. However, the second throws the following
error message:
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException:
IErrorInfo.GetDescription failed with E_FAIL(0x80004005).
Source Error:
Line 40: ObjAdapter.Fill(ObjDataSet,"hits")
What gives?? The code between the two are identical. There is no logical
difference between the two, and yet the second throws the error. I know
this, because removing the "WHERE Domain = 'domain.com'" makes it work
again. Problem is, my client uses up to 4 different domain names for his
web site, and I want to count the hits for each domain name.
IsUnique is a binary (yes/no) variable in the DB, and Domain is a
string. This is an Access db. Removing the single quotes from around the
Domain value makes no difference.
TIA to everyone that helps this poor sod.
....Geshel
--
************************************************************************
Reply-to e-mail forwards all received e-mails to SpamCop for UBE/UCE
(Unsolicited Bulk/Commercial E-mail) reporting. DO NOT USE THAT ADDRESS!
Please send e-mail to my first name at my last name dot org.
************************************************************************