SQL Statement trying to call column not specified in statement

T

Trepalium

I'm having some trouble with a sql statement within my sub. For some
reason, it wants to reference CLPROPSTRTNMBER when I specifically
asked for CLPROPSTRTNMBR (which is the correct column name). The code
is below. I cannot figure out why it's trying to pull this reference.

Public Sub D2REDataCall()
Call DBConnect

sql = "SELECT
CLMAILADDRESS,CLMAILCITY,CLMAILSTATE,CLMAILZIP,CLPROPSTRTNMBR,CLPROPSTREETADDR,CLPROPSTREETUNIT,CLPROPCITY,CLPROPSTATE,CLPROPZIP,CLPROPCOUNTY,CLCREDITREPORTDT,CLRATEEFFECTIVEDT,CLCLOSEDT,CLTOTALLOANAMT,CLINTERESTRATE,CLTILAPR,CLTERM
FROM " & tblCustInfoD2RE & " WHERE CLAPPLNUMBER = '" & AppID & "'"
rsdata.Open (sql)

MtxtStreetAddress.Enabled = True
MtxtStreetAddress.Value = rsdata("CLMAILADDRESS")
MtxtStreetAddress.Locked = True

MtxtCity.Enabled = True
MtxtCity.Value = rsdata("CLMAILCITY")
MtxtCity.Locked = True

MtxtState.Enabled = True
MtxtState.Value = rsdata("CLMAILSTATE")
MtxtState.Locked = True

MtxtZip.Enabled = True
MtxtZip.Value = rsdata("CLMAILZIP")
MtxtZip.Locked = True

PtxtStreetAddress.Enabled = True
PtxtStreetAddress.Value = rsdata("CLPROPSTRTNMBR") &
rsdata("CLPROPSTREETUNIT") & " " & rsdata("CLPROPSTREETADDR")
PtxtStreetAddress.Locked = True

PtxtCity.Enabled = True
PtxtCity.Value = rsdata("CLPROPCITY")
PtxtCity.Locked = True

PtxtState.Enabled = True
PtxtState.Value = rsdata("CLPROPSTATE")
PtxtState.Locked = True

PtxtZip.Enabled = True
PtxtZip.Value = rsdata("CLPROPZIP")
PtxtZip.Locked = True

PtxtCounty.Enabled = True
PtxtCounty.Value = rsdata("CLPROPCOUNTY")
PtxtCounty.Locked = True

Text586.Enabled = True
Text586.Value = rsdata("CLCREDITREPORTDT")
Text586.Locked = True

Text588.Enabled = True
Text588.Value = Format(rsdata("CLCREDITREPORTDT"), "MM/DD/YYYY") + 45
Text588.Locked = True

Text590.Enabled = True
Text590.Value = rsdata("CLRATEEFFECTIVEDT")
Text590.Locked = True

Text644.Enabled = True
Text644.Value = rsdata("CLCLOSEDT")
Text644.Locked = True

Text140.Enabled = True
Text140.Value = Format(rsdata("CLTOTALLOANAMT"), "$###,###.##")
Text140.Locked = True

Text205.Enabled = True
Text205.Value = rsdata("CLINTERESTRATE")
Text205.Locked = True

Text207.Enabled = True
Text207.Value = rsdata("CLTILAPR")
Text207.Locked = True

Text86.Enabled = True
Text86.Value = rsdata("CLTERM")
Text86.Locked = True

rsdata.Close


End Sub
 
B

Bob Hairgrove

I'm having some trouble with a sql statement within my sub. For some
reason, it wants to reference CLPROPSTRTNMBER when I specifically
asked for CLPROPSTRTNMBR (which is the correct column name). The code
is below. I cannot figure out why it's trying to pull this reference.

Public Sub D2REDataCall()
Call DBConnect

sql = "SELECT
CLMAILADDRESS,CLMAILCITY,CLMAILSTATE,CLMAILZIP,CLPROPSTRTNMBR,CLPROPSTREETADDR,CLPROPSTREETUNIT,CLPROPCITY,CLPROPSTATE,CLPROPZIP,CLPROPCOUNTY,CLCREDITREPORTDT,CLRATEEFFECTIVEDT,CLCLOSEDT,CLTOTALLOANAMT,CLINTERESTRATE,CLTILAPR,CLTERM
FROM " & tblCustInfoD2RE & " WHERE CLAPPLNUMBER = '" & AppID & "'"
rsdata.Open (sql)

MtxtStreetAddress.Enabled = True
MtxtStreetAddress.Value = rsdata("CLMAILADDRESS")
MtxtStreetAddress.Locked = True

MtxtCity.Enabled = True
MtxtCity.Value = rsdata("CLMAILCITY")
MtxtCity.Locked = True

MtxtState.Enabled = True
MtxtState.Value = rsdata("CLMAILSTATE")
MtxtState.Locked = True

MtxtZip.Enabled = True
MtxtZip.Value = rsdata("CLMAILZIP")
MtxtZip.Locked = True

PtxtStreetAddress.Enabled = True
PtxtStreetAddress.Value = rsdata("CLPROPSTRTNMBR") &
rsdata("CLPROPSTREETUNIT") & " " & rsdata("CLPROPSTREETADDR")
PtxtStreetAddress.Locked = True

PtxtCity.Enabled = True
PtxtCity.Value = rsdata("CLPROPCITY")
PtxtCity.Locked = True

PtxtState.Enabled = True
PtxtState.Value = rsdata("CLPROPSTATE")
PtxtState.Locked = True

PtxtZip.Enabled = True
PtxtZip.Value = rsdata("CLPROPZIP")
PtxtZip.Locked = True

PtxtCounty.Enabled = True
PtxtCounty.Value = rsdata("CLPROPCOUNTY")
PtxtCounty.Locked = True

Text586.Enabled = True
Text586.Value = rsdata("CLCREDITREPORTDT")
Text586.Locked = True

Text588.Enabled = True
Text588.Value = Format(rsdata("CLCREDITREPORTDT"), "MM/DD/YYYY") + 45
Text588.Locked = True

Text590.Enabled = True
Text590.Value = rsdata("CLRATEEFFECTIVEDT")
Text590.Locked = True

Text644.Enabled = True
Text644.Value = rsdata("CLCLOSEDT")
Text644.Locked = True

Text140.Enabled = True
Text140.Value = Format(rsdata("CLTOTALLOANAMT"), "$###,###.##")
Text140.Locked = True

Text205.Enabled = True
Text205.Value = rsdata("CLINTERESTRATE")
Text205.Locked = True

Text207.Enabled = True
Text207.Value = rsdata("CLTILAPR")
Text207.Locked = True

Text86.Enabled = True
Text86.Value = rsdata("CLTERM")
Text86.Locked = True

rsdata.Close


End Sub

What is the type of database where the tables are? IIRC, there was a
limitation of ten characters in some names on Oracle 8i -- maybe the
names are too long? (BTW, you really should rename the controls of
your form to something meaningful/human readable).
 
T

Trepalium

What is the type of database where the tables are? IIRC, there was a
limitation of ten characters in some names on Oracle 8i -- maybe the
names are too long? (BTW, you really should rename the controls of
your form to something meaningful/human readable).

--
Bob Hairgrove
(e-mail address removed)- Hide quoted text -

- Show quoted text -

Sorry this is SQL Server 2000
 
Top