theclassic
asked on
Accessing newly converted (from Access) SQL DB for ASP.NET calculator application...
I created a new SQL database based on the old access database we can no longer use - it is a repository of three dates and a number - specifically I converted in access three "date/time" columns to SQL "shortdatetime" columns and the "long int" in access to "int" in SQL. Then I populated (sucessfully, I assume) the new SQL DB with all of the values for each row (over 1300).
When I made changes to the code to access the new database I get the error...
Exception Details: System.Data.OleDb.OleDbExc eption: Incorrect syntax near '#'.
Source Error:
Line 242: dim objConnection as new oledbconnection(strConnect ion)
Line 243: dim objAdapter as new oledbdataadapter(strSQL, objConnection)
Line 244: objAdapter.fill(objDataSet , "PreCalculatedValues")
Line 245:
Line 246: if objDataSet.tables(0).rows. count > 0 then
I am using a web.config to define the connection string (which I believe is correct), and then added this to the code....
<%@ Page language="vb" debug="true" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.Ole db" %>
<%@ Import Namespace="System.Configur ation" %>
<!--New Addition of Namespace System.Configuration-->
<script language="vb" runat="server">
Dim database As String = "InternalConnect"
And....
'NEW FUNCTION FOR SQL CONVERSION
' Retrieves a connection string by name.
' Returns Nothing if the name is not found.
Function GetConnectionString() As String
' Assume failure
Dim returnValue As String = Nothing
' Look for the name in the connectionStrings section.
Dim settings As ConnectionStringSettings = _
ConfigurationManager.Conne ctionStrin gs(databas e)
' If found, return the connection string.
If Not settings Is Nothing Then
returnValue = settings.ConnectionString
End If
Return returnValue
End Function
And then changed the old connections for the Access DB to this for the functions accessing the new SQL DB...
function GetNextContributionDate(da teProjecti on as datetime) as datetime
Dim strConnection As String = GetConnectionString() 'New Code etc...
ANy ideas..?
When I made changes to the code to access the new database I get the error...
Exception Details: System.Data.OleDb.OleDbExc
Source Error:
Line 242: dim objConnection as new oledbconnection(strConnect
Line 243: dim objAdapter as new oledbdataadapter(strSQL, objConnection)
Line 244: objAdapter.fill(objDataSet
Line 245:
Line 246: if objDataSet.tables(0).rows.
I am using a web.config to define the connection string (which I believe is correct), and then added this to the code....
<%@ Page language="vb" debug="true" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.Ole
<%@ Import Namespace="System.Configur
<!--New Addition of Namespace System.Configuration-->
<script language="vb" runat="server">
Dim database As String = "InternalConnect"
And....
'NEW FUNCTION FOR SQL CONVERSION
' Retrieves a connection string by name.
' Returns Nothing if the name is not found.
Function GetConnectionString() As String
' Assume failure
Dim returnValue As String = Nothing
' Look for the name in the connectionStrings section.
Dim settings As ConnectionStringSettings = _
ConfigurationManager.Conne
' If found, return the connection string.
If Not settings Is Nothing Then
returnValue = settings.ConnectionString
End If
Return returnValue
End Function
And then changed the old connections for the Access DB to this for the functions accessing the new SQL DB...
function GetNextContributionDate(da
Dim strConnection As String = GetConnectionString() 'New Code etc...
ANy ideas..?
its kinda unclear where the error is happening. But clearly ther is a syntax error...
I have the feeling that it has to do with your connection string.
You should be able to identify that quick.
I'd say post the connection string to your SQL database and someone will prolly tell you whether its valid or not.
I have the feeling that it has to do with your connection string.
You should be able to identify that quick.
I'd say post the connection string to your SQL database and someone will prolly tell you whether its valid or not.
What is the value of strSQL?
the_bachelor is right there's a syntax error in the SQL ... I suspect it's the SQL in that variable ... and it has to do w/ how you're wrapping a date.
the_bachelor is right there's a syntax error in the SQL ... I suspect it's the SQL in that variable ... and it has to do w/ how you're wrapping a date.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I actually had the table named wrong - I was using the name of the old one, but I am still having issues....
The database SQL Table I created in an existing database "Clients" is called Calculator, with four columns PayCalender (shrtdatetime), Cutoff (shrtdatetime), Periods (int) and PayCalender2 (shrtdatetime).
The WEb.config is this
<?xml version="1.0"?>
<configuration>
<configSections> </configSections>
<appSettings>
</appSettings>
<connectionStrings>
<add name="ClientConnect" connectionString="Provider =SQLNCLI; Server=DSN ; Database=clients;Uid=user; Pwd=pass;" />
</connectionStrings>
<system.web>
</system.web>
</configuration>
The asp.net code is here :
<%@ Page language="vb" debug="true" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.Ole db" %>
<%@ Import Namespace="System.Configur ation" %>
<!--New Addition of Namespace System.Configuration-->
<script language="vb" runat="server">
Dim database As String = "ClientConnect"
dim dateProjection as datetime
dim dateNextContribution as datetime
dim dateBirth as datetime
dim intAgeInCalendarYear as integer
dim intPayPeriodsRemaining as integer
dim dblSalary as double
dim dblCurrentContributionAmou nt as double
dim dblMaximumContributionAmou nt as double
dim dblMaximumContributionAmou ntWithCatc hUp as double
dim dblMaximizedPercentage as double
dim dblMaximizedPercentageWith CatchUp as double
dim dblPretaxPayCheckDeduction as double
dim dblPretaxPayCheckDeduction WithCatchU p as double
dim bolCatchUpAllowed as boolean
sub page_load(sender as object, e as eventargs)
if not page.isPostBack() then
InitializeFormFields()
hideAllPanels()
pnlIntroduction.visible = true
end if
end sub
sub InitializeFormFields()
txtProjectionDate.text = now.tostring("MM/dd/yyyy")
end sub
sub onBack1Clicked(sender as object, e as eventargs)
response.redirect("plan_ru les1.html" )
end sub
sub onBack2Clicked(sender as object, e as eventargs)
hideAllPanels()
pnlIntroduction.visible = true
end sub
sub onBack3Clicked(sender as object, e as eventargs)
hideAllPanels()
pnlInput.visible = true
end sub
sub onStartClicked(sender as object, e as eventargs)
hideAllPanels()
pnlInput.visible = true
end sub
sub onCalculateClicked(sender as object, e as eventargs)
if isDate(txtProjectionDate.t ext) then
'Check the date format (for looks I suppose...) as per client request
dim arrProjectionDateParts() as string = txtProjectionDate.text.spl it("/")
if UBound(arrProjectionDatePa rts) = 2 then
dim strProjectionDateMM as string = arrProjectionDateParts(0)
dim strProjectionDateDD as string = arrProjectionDateParts(1)
dim strProjectionDateYYYY as string = arrProjectionDateParts(2)
if (len(strProjectionDateMM) <> 2 or len(strProjectionDateDD) <> 2 or len(strProjectionDateYYYY) <> 4) then
'Show Date of Projection Error
pnlProjectionDateErrorMess age.visibl e = true
txtProjectionDate.backcolo r = system.drawing.color.yello w
exit sub
else
'Hide Date of Birth Error
pnlProjectionDateErrorMess age.visibl e = false
txtProjectionDate.backcolo r = nothing
end if
else
'Show Date of Projection Error
pnlProjectionDateErrorMess age.visibl e = true
txtProjectionDate.backcolo r = system.drawing.color.yello w
exit sub
end if
dateProjection = CDate(txtProjectionDate.te xt)
else
'Show Date of Projection Error
pnlProjectionDateErrorMess age.visibl e = true
txtProjectionDate.backcolo r = system.drawing.color.yello w
exit sub
end if
if isNumeric(txtSalary.text) then
dblSalary = txtSalary.text
if dblSalary < 0 then
'Show Salary Error
pnlSalaryErrorMessage.visi ble = true
txtSalary.backcolor = system.drawing.color.yello w
exit sub
else
'Hide Salary Error
pnlSalaryErrorMessage.visi ble = false
txtSalary.backcolor = nothing
end if
else
'Show Salary Error
pnlSalaryErrorMessage.visi ble = true
txtSalary.backcolor = system.drawing.color.yello w
exit sub
end if
if isDate(txtBirthdate.text) then
'Check the date format (for looks I suppose...) as per client request
dim arrBirthDateParts() as string = txtBirthDate.text.split("/ ")
if UBound(arrBirthDateParts) = 2 then
dim strBirthDateMM as string = arrBirthDateParts(0)
dim strBirthDateDD as string = arrBirthDateParts(1)
dim strBirthDateYYYY as string = arrBirthDateParts(2)
if (len(strBirthDateMM) <> 2 or len(strBirthDateDD) <> 2 or len(strBirthDateYYYY) <> 4) then
'Show Date of Birth Error
pnlBirthdateErrorMessage.v isible = true
txtBirthdate.backcolor = system.drawing.color.yello w
exit sub
end if
else
'Show Date of Birth Error
pnlBirthdateErrorMessage.v isible = true
txtBirthdate.backcolor = system.drawing.color.yello w
exit sub
end if
dateBirth = CDate(txtBirthdate.text)
if dateBirth < dateProjection then
intAgeInCalendarYear = dateProjection.year() - dateBirth.year()
lblAgeInCalendarYear.text = intAgeInCalendarYear
'Hide Date of Birth Error
pnlBirthdateErrorMessage.v isible = false
txtBirthdate.backcolor = nothing
else
'Show Date of Birth Error
pnlBirthdateErrorMessage.v isible = true
txtBirthdate.backcolor = system.drawing.color.yello w
exit sub
end if
else
'Show Date of Birth Error
pnlBirthdateErrorMessage.v isible = true
txtBirthdate.backcolor = system.drawing.color.yello w
exit sub
end if
if isNumeric(txtContributionA mount.text ) then
dblCurrentContributionAmou nt = txtContributionAmount.text
if dblCurrentContributionAmou nt < 0 then
'Show Contribution Amount Error
pnlContributionAmountError Message.vi sible = true
txtContributionAmount.back color = system.drawing.color.yello w
exit sub
else
dblCurrentContributionAmou nt = Cdbl(txtContributionAmount .text)
pnlContributionAmountError Message.vi sible = false
'Hide Contribution Amount Error
txtContributionAmount.back color = nothing
end if
else
'Show Contribution Amount Error
pnlContributionAmountError Message.vi sible = true
txtContributionAmount.back color = system.drawing.color.yello w
exit sub
end if
dateNextContribution = GetNextContributionDate(da teProjecti on)
lblNextContributionDate.te xt = dateNextContribution.tosho rtdatestri ng()
intPayPeriodsRemaining = GetPayPeriodsRemaining(dat eProjectio n, dateNextContribution)
lblRemainingPayPeriods.tex t = intPayPeriodsRemaining
dblMaximumContributionAmou nt = GetMaximizedContributionAm ount(dateP rojection)
dblMaximizedPercentage = GetMaximizedPercentage(dbl Salary, dblCurrentContributionAmou nt, dblMaximumContributionAmou nt, intPayPeriodsRemaining)
lblMaximizedPercentage.tex t = dblMaximizedPercentage * 100 & "%"
dblMaximumContributionAmou ntWithCatc hUp = GetMaximizedContributionAm ountWithCa tchUp(date Projection )
dblMaximizedPercentageWith CatchUp = GetMaximizedPercentage(dbl Salary, dblCurrentContributionAmou nt, dblMaximumContributionAmou ntWithCatc hUp, intPayPeriodsRemaining)
if intAgeInCalendarYear >= 50 then
'Show Amount Eligible with Catchup
lblMaximizedPercentageWith CatchUp.te xt = dblMaximizedPercentageWith CatchUp * 100 & "%"
else
'Show Not Eligible for Catchup
lblMaximizedPercentageWith CatchUp.te xt = "You are not eligible until age 50"
end if
dblPretaxPayCheckDeduction = GetPretaxPaycheckDeduction (dblSalary , dblMaximizedPercentage)
lblPretaxPaycheckDeduction Amount.tex t = FormatCurrency(dblPretaxPa yCheckDedu ction)
dblPretaxPayCheckDeduction WithCatchu p = GetPretaxPaycheckDeduction (dblSalary , dblMaximizedPercentageWith CatchUp)
if intAgeInCalendarYear >= 50 then
'Show Amount Eligible with Catchup
lblPretaxPaycheckDeduction AmountWith CatchUp.te xt = FormatCurrency(dblPretaxPa yCheckDedu ctionWithC atchup)
else
'Show Not Eligible for Catchup
lblPretaxPaycheckDeduction AmountWith CatchUp.te xt = "You are not eligible until age 50"
end if
hideAllPanels()
pnlResults.visible = true
end sub
'NEW FUNCTION FOR SQL CONVERSION
' Retrieves a connection string by name.
' Returns Nothing if the name is not found.
Function GetConnectionString() As String
' Assume failure
Dim returnValue As String = Nothing
' Look for the name in the connectionStrings section.
Dim settings As ConnectionStringSettings = _
ConfigurationManager.Conne ctionStrin gs(databas e)
' If found, return the connection string.
If Not settings Is Nothing Then
returnValue = settings.ConnectionString
End If
Return returnValue
End Function
function GetNextContributionDate(da teProjecti on as datetime) as datetime
Dim strConnection As String = GetConnectionString() 'New Code
dim strSQL as string = "SELECT TOP 1 PayCalendar2 FROM NomuraCalculator WHERE [K-CutOff] >= #" & dateProjection.toshortdate string() & "#"
dim objDataSet as new DataSet()
dim objConnection as new oledbconnection(strConnect ion)
dim objAdapter as new oledbdataadapter(strSQL, objConnection)
objAdapter.fill(objDataSet , "Calculator")
if objDataSet.tables(0).rows. count > 0 then
return objDataSet.tables(0).rows( 0)("PayCal endar2")
end if
end function
function GetPayPeriodsRemaining(dat eProjectio n as datetime, dateNextContributionDate as datetime) as integer
Dim strConnection As String = GetConnectionString() ' New Code
dim strSQL as string = "SELECT TOP 1 PayPeriodsRemaining FROM Calculator WHERE [K-CutOff] >= #" & dateProjection.toshortdate string() & "#"
IS THE ABOVE LINE LOOK LIKE WHAT YOU WERE MENTIONING>>>
dim objDataSet as new DataSet()
dim objConnection as new oledbconnection(strConnect ion)
dim objAdapter as new oledbdataadapter(strSQL, objConnection)
objAdapter.fill(objDataSet , "Calculator")
if objDataSet.tables(0).rows. count > 0 then
if dateProjection.toshortdate string() <> dateNextContributionDate.t oshortdate string() then
return objDataSet.tables(0).rows( 0)("PayPer iodsRemain ing") + 1
else
return objDataSet.tables(0).rows( 0)("PayPer iodsRemain ing")
end if
end if
end function
function GetMaximizedContributionAm ount(dateP rojection as datetime) as double
if dateProjection.addDays(14) .year = 2005 then
return 14000
else if dateProjection.addDays(14) .year = 2006 then
return 15000
else if dateProjection.addDays(14) .year = 2007
return 15500
else
return 15500
end if
end function
function GetMaximizedContributionAm ountWithCa tchUp(date Projection as datetime) as double
if dateProjection.addDays(14) .year = 2005 then
return 18000
else if dateProjection.addDays(14) .year = 2006 then
return 20000
else if dateProjection.addDays(14) .year = 2007
return 20500
else
return 20500
end if
end function
function GetMaximizedPercentage(dbl Salary as double, dblCurrentContributionAmou nt as double, dblMaximumContributionAmou nt as double, intPayPeriodsRemaining as integer) as double
return math.min(0.7, math.Round((((dblMaximumCo ntribution Amount-dbl CurrentCon tributionA mount)/int PayPeriods Remaining) /(dblSalar y/26)) + 0.005, 2))
end function
function GetPretaxPaycheckDeduction (dblSalary as double, dblMaximizedPercentage as double) as double
return math.round(dblSalary / 26 * dblMaximizedPercentage, 2)
end function
sub hideAllPanels()
pnlIntroduction.visible = false
pnlInput.visible = false
pnlResults.visible = false
end sub
</script>
I highlighted in Bold some of the few changees, as well as renaming the new table name whereever the old one was mentioned....
The database SQL Table I created in an existing database "Clients" is called Calculator, with four columns PayCalender (shrtdatetime), Cutoff (shrtdatetime), Periods (int) and PayCalender2 (shrtdatetime).
The WEb.config is this
<?xml version="1.0"?>
<configuration>
<configSections> </configSections>
<appSettings>
</appSettings>
<connectionStrings>
<add name="ClientConnect" connectionString="Provider
</connectionStrings>
<system.web>
</system.web>
</configuration>
The asp.net code is here :
<%@ Page language="vb" debug="true" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.Ole
<%@ Import Namespace="System.Configur
<!--New Addition of Namespace System.Configuration-->
<script language="vb" runat="server">
Dim database As String = "ClientConnect"
dim dateProjection as datetime
dim dateNextContribution as datetime
dim dateBirth as datetime
dim intAgeInCalendarYear as integer
dim intPayPeriodsRemaining as integer
dim dblSalary as double
dim dblCurrentContributionAmou
dim dblMaximumContributionAmou
dim dblMaximumContributionAmou
dim dblMaximizedPercentage as double
dim dblMaximizedPercentageWith
dim dblPretaxPayCheckDeduction
dim dblPretaxPayCheckDeduction
dim bolCatchUpAllowed as boolean
sub page_load(sender as object, e as eventargs)
if not page.isPostBack() then
InitializeFormFields()
hideAllPanels()
pnlIntroduction.visible = true
end if
end sub
sub InitializeFormFields()
txtProjectionDate.text = now.tostring("MM/dd/yyyy")
end sub
sub onBack1Clicked(sender as object, e as eventargs)
response.redirect("plan_ru
end sub
sub onBack2Clicked(sender as object, e as eventargs)
hideAllPanels()
pnlIntroduction.visible = true
end sub
sub onBack3Clicked(sender as object, e as eventargs)
hideAllPanels()
pnlInput.visible = true
end sub
sub onStartClicked(sender as object, e as eventargs)
hideAllPanels()
pnlInput.visible = true
end sub
sub onCalculateClicked(sender as object, e as eventargs)
if isDate(txtProjectionDate.t
'Check the date format (for looks I suppose...) as per client request
dim arrProjectionDateParts() as string = txtProjectionDate.text.spl
if UBound(arrProjectionDatePa
dim strProjectionDateMM as string = arrProjectionDateParts(0)
dim strProjectionDateDD as string = arrProjectionDateParts(1)
dim strProjectionDateYYYY as string = arrProjectionDateParts(2)
if (len(strProjectionDateMM) <> 2 or len(strProjectionDateDD) <> 2 or len(strProjectionDateYYYY)
'Show Date of Projection Error
pnlProjectionDateErrorMess
txtProjectionDate.backcolo
exit sub
else
'Hide Date of Birth Error
pnlProjectionDateErrorMess
txtProjectionDate.backcolo
end if
else
'Show Date of Projection Error
pnlProjectionDateErrorMess
txtProjectionDate.backcolo
exit sub
end if
dateProjection = CDate(txtProjectionDate.te
else
'Show Date of Projection Error
pnlProjectionDateErrorMess
txtProjectionDate.backcolo
exit sub
end if
if isNumeric(txtSalary.text) then
dblSalary = txtSalary.text
if dblSalary < 0 then
'Show Salary Error
pnlSalaryErrorMessage.visi
txtSalary.backcolor = system.drawing.color.yello
exit sub
else
'Hide Salary Error
pnlSalaryErrorMessage.visi
txtSalary.backcolor = nothing
end if
else
'Show Salary Error
pnlSalaryErrorMessage.visi
txtSalary.backcolor = system.drawing.color.yello
exit sub
end if
if isDate(txtBirthdate.text) then
'Check the date format (for looks I suppose...) as per client request
dim arrBirthDateParts() as string = txtBirthDate.text.split("/
if UBound(arrBirthDateParts) = 2 then
dim strBirthDateMM as string = arrBirthDateParts(0)
dim strBirthDateDD as string = arrBirthDateParts(1)
dim strBirthDateYYYY as string = arrBirthDateParts(2)
if (len(strBirthDateMM) <> 2 or len(strBirthDateDD) <> 2 or len(strBirthDateYYYY) <> 4) then
'Show Date of Birth Error
pnlBirthdateErrorMessage.v
txtBirthdate.backcolor = system.drawing.color.yello
exit sub
end if
else
'Show Date of Birth Error
pnlBirthdateErrorMessage.v
txtBirthdate.backcolor = system.drawing.color.yello
exit sub
end if
dateBirth = CDate(txtBirthdate.text)
if dateBirth < dateProjection then
intAgeInCalendarYear = dateProjection.year() - dateBirth.year()
lblAgeInCalendarYear.text = intAgeInCalendarYear
'Hide Date of Birth Error
pnlBirthdateErrorMessage.v
txtBirthdate.backcolor = nothing
else
'Show Date of Birth Error
pnlBirthdateErrorMessage.v
txtBirthdate.backcolor = system.drawing.color.yello
exit sub
end if
else
'Show Date of Birth Error
pnlBirthdateErrorMessage.v
txtBirthdate.backcolor = system.drawing.color.yello
exit sub
end if
if isNumeric(txtContributionA
dblCurrentContributionAmou
if dblCurrentContributionAmou
'Show Contribution Amount Error
pnlContributionAmountError
txtContributionAmount.back
exit sub
else
dblCurrentContributionAmou
pnlContributionAmountError
'Hide Contribution Amount Error
txtContributionAmount.back
end if
else
'Show Contribution Amount Error
pnlContributionAmountError
txtContributionAmount.back
exit sub
end if
dateNextContribution = GetNextContributionDate(da
lblNextContributionDate.te
intPayPeriodsRemaining = GetPayPeriodsRemaining(dat
lblRemainingPayPeriods.tex
dblMaximumContributionAmou
dblMaximizedPercentage = GetMaximizedPercentage(dbl
lblMaximizedPercentage.tex
dblMaximumContributionAmou
dblMaximizedPercentageWith
if intAgeInCalendarYear >= 50 then
'Show Amount Eligible with Catchup
lblMaximizedPercentageWith
else
'Show Not Eligible for Catchup
lblMaximizedPercentageWith
end if
dblPretaxPayCheckDeduction
lblPretaxPaycheckDeduction
dblPretaxPayCheckDeduction
if intAgeInCalendarYear >= 50 then
'Show Amount Eligible with Catchup
lblPretaxPaycheckDeduction
else
'Show Not Eligible for Catchup
lblPretaxPaycheckDeduction
end if
hideAllPanels()
pnlResults.visible = true
end sub
'NEW FUNCTION FOR SQL CONVERSION
' Retrieves a connection string by name.
' Returns Nothing if the name is not found.
Function GetConnectionString() As String
' Assume failure
Dim returnValue As String = Nothing
' Look for the name in the connectionStrings section.
Dim settings As ConnectionStringSettings = _
ConfigurationManager.Conne
' If found, return the connection string.
If Not settings Is Nothing Then
returnValue = settings.ConnectionString
End If
Return returnValue
End Function
function GetNextContributionDate(da
Dim strConnection As String = GetConnectionString() 'New Code
dim strSQL as string = "SELECT TOP 1 PayCalendar2 FROM NomuraCalculator WHERE [K-CutOff] >= #" & dateProjection.toshortdate
dim objDataSet as new DataSet()
dim objConnection as new oledbconnection(strConnect
dim objAdapter as new oledbdataadapter(strSQL, objConnection)
objAdapter.fill(objDataSet
if objDataSet.tables(0).rows.
return objDataSet.tables(0).rows(
end if
end function
function GetPayPeriodsRemaining(dat
Dim strConnection As String = GetConnectionString() ' New Code
dim strSQL as string = "SELECT TOP 1 PayPeriodsRemaining FROM Calculator WHERE [K-CutOff] >= #" & dateProjection.toshortdate
IS THE ABOVE LINE LOOK LIKE WHAT YOU WERE MENTIONING>>>
dim objDataSet as new DataSet()
dim objConnection as new oledbconnection(strConnect
dim objAdapter as new oledbdataadapter(strSQL, objConnection)
objAdapter.fill(objDataSet
if objDataSet.tables(0).rows.
if dateProjection.toshortdate
return objDataSet.tables(0).rows(
else
return objDataSet.tables(0).rows(
end if
end if
end function
function GetMaximizedContributionAm
if dateProjection.addDays(14)
return 14000
else if dateProjection.addDays(14)
return 15000
else if dateProjection.addDays(14)
return 15500
else
return 15500
end if
end function
function GetMaximizedContributionAm
if dateProjection.addDays(14)
return 18000
else if dateProjection.addDays(14)
return 20000
else if dateProjection.addDays(14)
return 20500
else
return 20500
end if
end function
function GetMaximizedPercentage(dbl
return math.min(0.7, math.Round((((dblMaximumCo
end function
function GetPretaxPaycheckDeduction
return math.round(dblSalary / 26 * dblMaximizedPercentage, 2)
end function
sub hideAllPanels()
pnlIntroduction.visible = false
pnlInput.visible = false
pnlResults.visible = false
end sub
</script>
I highlighted in Bold some of the few changees, as well as renaming the new table name whereever the old one was mentioned....
dim strSQL as string = "SELECT TOP 1 PayPeriodsRemaining FROM Calculator WHERE [K-CutOff] >= #" & dateProjection.toshortdate
string() & "#"
IS THE ABOVE LINE LOOK LIKE WHAT YOU WERE MENTIONING>>>
Yesstring() & "#"
IS THE ABOVE LINE LOOK LIKE WHAT YOU WERE MENTIONING>>>
dim strSQL as string = "SELECT TOP 1 PayPeriodsRemaining FROM Calculator WHERE [K-CutOff] >= '" & dateProjection.toshortdate string() & "'"
Congrats, Brad.
that's what I'd be looking for ...