-
Export variable problem
I am using the dbExportFlds command exactly as shown in the documentation and examples, but I can't seem to find the value stored in the variables by displaying them. I have tried to use FieldName format as both table.fieldname and fieldname in the session variable, but neither seems to work. Am I doing something wrong? Thanks in advance for any help.
Code:
<%
Set MyDb = Server.CreateObject("ASPdb.Free"
Mydb.dbUnit = 100
MyDb.dbMDB = Server.MapPath("CCU.mdb"
TmpRemember = Request("Company"
TmpRemember = Replace(TmpRemember,"'","'' ;"
if (TmpRemember <> "" then
Session("NameRemember" = TmpRemember
MyDb.dbReset(100)
end if
WhereClause = Session("NameRemember" + "%"
sq = "SELECT Member.UserID, Member.CompanyName, Member.CompanyLocation, Member.BusinessType, Contacts.ContactName, Contacts.ContactTitle, Contacts.Responsibilities, Contacts.NotInterested, Contacts.Interested, Contacts.Preferred FROM Member INNER JOIN Contacts ON Member.UserID = Contacts.UserID WHERE Member.CompanyName LIKE '" & WhereClause & "'"
MyDb.dbColor = "4,auto,lightblue"
MyDb.dbGridtabletag = "border=4 cellpadding=4 cellspacing=4"
MyDb.dbFormtabletag = "border=4 cellpadding=4 cellspacing=4"
MyDb.dbMode = "both"
MyDb.dbFormMemo = "10 x 75,Contacts.Responsibilities, Contacts.NotInterested, Contacts.Interested"
MyDb.dbSQL = sq
MyDb.dbImageDir="/Aspdb/images/"
MyDb.dbNavigationItem="top, bottom, next, prev"
MyDb.dbNavigationIcon="std"
MyDb.dbButtonAnchor = false
MyDb.dbSuppressMsg = true
MyDb.dbSelectFrom = True
MyDb.dbGridHideFlds = "0,6,7,8,9"
MyDb.dbFormHideFlds = "0,6,7,8"
MyDb.dbExportFlds = "Member.UserID, Member.CompanyName,
Contacts.ContactName"
MyDb.dbNameMap = "Member.CompanyName, Company Name,; Member.CompanyLocation, Company Location,; Member.BusinessType, Business Type,; Contacts.ContactName, Contact Name,; Contacts.ContactTitle, Title,; Contacts.Preferred, Method of Contact,; Contacts.Responsibilities, Purchasing Responsibilities,; Contacts.NotInterested, Not Interested - Don't Contact Us,; Contacts.Interested, May Be Interested (See Method of Contact Above), Align = Center; Span=2"
MyDb.ASPdbFree
RECS = MyDB.dbRecordCount
%>
In a separate asp file:
<%
Response.write("<P>You selected:<BR>"
Response.write("Company Name: " & Session("ASPdb_100_Member.CompanyName")
Response.write("<BR>"
Response.write("Contact Name: " & Session("ASPdb_100_Contacts.ContactName")
Response.write("<BR>"
%>
-
Export variable problem (reply)
Try replacing the fieldname by its corresponding index. Index is the position of the field in your sql query (sq, in your case) and it starts to 0.
MyDb.dbExportFlds = "0, 1,4#34;
In your separate asp file:
<%
Response.write("<P>You selected:<BR>"
Response.write("Company Name: " & Session("ASPdb_1_CompanyName")
Response.write("<BR>"
Response.write("Contact Name: " & Session("ASPdb_4_Contacts.ContactName")
Response.write("<BR>"
%>
------------
Greg Ivins at 12/31/99 1:03:00 AM
I am using the dbExportFlds command exactly as shown in the documentation and examples, but I can't seem to find the value stored in the variables by displaying them. I have tried to use FieldName format as both table.fieldname and fieldname in the session variable, but neither seems to work. Am I doing something wrong? Thanks in advance for any help.
Code:
<%
Set MyDb = Server.CreateObject("ASPdb.Free"
Mydb.dbUnit = 100
MyDb.dbMDB = Server.MapPath("CCU.mdb"
TmpRemember = Request("Company"
TmpRemember = Replace(TmpRemember,"'","'' ;"
if (TmpRemember <> "" then
Session("NameRemember" = TmpRemember
MyDb.dbReset(100)
end if
WhereClause = Session("NameRemember" + "%"
sq = "SELECT Member.UserID, Member.CompanyName, Member.CompanyLocation, Member.BusinessType, Contacts.ContactName, Contacts.ContactTitle, Contacts.Responsibilities, Contacts.NotInterested, Contacts.Interested, Contacts.Preferred FROM Member INNER JOIN Contacts ON Member.UserID = Contacts.UserID WHERE Member.CompanyName LIKE '" & WhereClause & "'"
MyDb.dbColor = "4,auto,lightblue"
MyDb.dbGridtabletag = "border=4 cellpadding=4 cellspacing=4"
MyDb.dbFormtabletag = "border=4 cellpadding=4 cellspacing=4"
MyDb.dbMode = "both"
MyDb.dbFormMemo = "10 x 75,Contacts.Responsibilities, Contacts.NotInterested, Contacts.Interested"
MyDb.dbSQL = sq
MyDb.dbImageDir="/Aspdb/images/"
MyDb.dbNavigationItem="top, bottom, next, prev"
MyDb.dbNavigationIcon="std"
MyDb.dbButtonAnchor = false
MyDb.dbSuppressMsg = true
MyDb.dbSelectFrom = True
MyDb.dbGridHideFlds = "0,6,7,8,9"
MyDb.dbFormHideFlds = "0,6,7,8"
MyDb.dbExportFlds = "Member.UserID, Member.CompanyName,
Contacts.ContactName"
MyDb.dbNameMap = "Member.CompanyName, Company Name,; Member.CompanyLocation, Company Location,; Member.BusinessType, Business Type,; Contacts.ContactName, Contact Name,; Contacts.ContactTitle, Title,; Contacts.Preferred, Method of Contact,; Contacts.Responsibilities, Purchasing Responsibilities,; Contacts.NotInterested, Not Interested - Don't Contact Us,; Contacts.Interested, May Be Interested (See Method of Contact Above), Align = Center; Span=2"
MyDb.ASPdbFree
RECS = MyDB.dbRecordCount
%>
In a separate asp file:
<%
Response.write("<P>You selected:<BR>"
Response.write("Company Name: " & Session("ASPdb_100_Member.CompanyName")
Response.write("<BR>"
Response.write("Contact Name: " & Session("ASPdb_100_Contacts.ContactName")
Response.write("<BR>"
%>
-
Export variable problem (reply)
Try replacing the fieldname by its corresponding index. Index is the position of the field in your sql query (sq, in your case) and it starts to 0.
MyDb.dbExportFlds = "0, 1,4#34;
In your separate asp file:
<%
Response.write("<P>You selected:<BR>"
Response.write("Company Name: " & Session("ASPdb_1_CompanyName")
Response.write("<BR>"
Response.write("Contact Name: " & Session("ASPdb_4_Contacts.ContactName")
Response.write("<BR>"
%>
------------
Greg Ivins at 12/31/99 1:03:00 AM
I am using the dbExportFlds command exactly as shown in the documentation and examples, but I can't seem to find the value stored in the variables by displaying them. I have tried to use FieldName format as both table.fieldname and fieldname in the session variable, but neither seems to work. Am I doing something wrong? Thanks in advance for any help.
Code:
<%
Set MyDb = Server.CreateObject("ASPdb.Free"
Mydb.dbUnit = 100
MyDb.dbMDB = Server.MapPath("CCU.mdb"
TmpRemember = Request("Company"
TmpRemember = Replace(TmpRemember,"'","'' ;"
if (TmpRemember <> "" then
Session("NameRemember" = TmpRemember
MyDb.dbReset(100)
end if
WhereClause = Session("NameRemember" + "%"
sq = "SELECT Member.UserID, Member.CompanyName, Member.CompanyLocation, Member.BusinessType, Contacts.ContactName, Contacts.ContactTitle, Contacts.Responsibilities, Contacts.NotInterested, Contacts.Interested, Contacts.Preferred FROM Member INNER JOIN Contacts ON Member.UserID = Contacts.UserID WHERE Member.CompanyName LIKE '" & WhereClause & "'"
MyDb.dbColor = "4,auto,lightblue"
MyDb.dbGridtabletag = "border=4 cellpadding=4 cellspacing=4"
MyDb.dbFormtabletag = "border=4 cellpadding=4 cellspacing=4"
MyDb.dbMode = "both"
MyDb.dbFormMemo = "10 x 75,Contacts.Responsibilities, Contacts.NotInterested, Contacts.Interested"
MyDb.dbSQL = sq
MyDb.dbImageDir="/Aspdb/images/"
MyDb.dbNavigationItem="top, bottom, next, prev"
MyDb.dbNavigationIcon="std"
MyDb.dbButtonAnchor = false
MyDb.dbSuppressMsg = true
MyDb.dbSelectFrom = True
MyDb.dbGridHideFlds = "0,6,7,8,9"
MyDb.dbFormHideFlds = "0,6,7,8"
MyDb.dbExportFlds = "Member.UserID, Member.CompanyName,
Contacts.ContactName"
MyDb.dbNameMap = "Member.CompanyName, Company Name,; Member.CompanyLocation, Company Location,; Member.BusinessType, Business Type,; Contacts.ContactName, Contact Name,; Contacts.ContactTitle, Title,; Contacts.Preferred, Method of Contact,; Contacts.Responsibilities, Purchasing Responsibilities,; Contacts.NotInterested, Not Interested - Don't Contact Us,; Contacts.Interested, May Be Interested (See Method of Contact Above), Align = Center; Span=2"
MyDb.ASPdbFree
RECS = MyDB.dbRecordCount
%>
In a separate asp file:
<%
Response.write("<P>You selected:<BR>"
Response.write("Company Name: " & Session("ASPdb_100_Member.CompanyName")
Response.write("<BR>"
Response.write("Contact Name: " & Session("ASPdb_100_Contacts.ContactName")
Response.write("<BR>"
%>
-
Export variable problem (reply)
Greg,
In order for export to work, you must specify the fields to be exported using either their number (starting at zero) or their name, but NOT the Tablename.fieldname syntax.
See http://www.aspdb.com/test/export-join.asp
I hope this example helps you.
Mark.
------------
Greg Ivins at 12/31/99 1:03:00 AM
I am using the dbExportFlds command exactly as shown in the documentation and examples, but I can't seem to find the value stored in the variables by displaying them. I have tried to use FieldName format as both table.fieldname and fieldname in the session variable, but neither seems to work. Am I doing something wrong? Thanks in advance for any help.
Code:
<%
Set MyDb = Server.CreateObject("ASPdb.Free"
Mydb.dbUnit = 100
MyDb.dbMDB = Server.MapPath("CCU.mdb"
TmpRemember = Request("Company"
TmpRemember = Replace(TmpRemember,"'","'' ;"
if (TmpRemember <> "" then
Session("NameRemember" = TmpRemember
MyDb.dbReset(100)
end if
WhereClause = Session("NameRemember" + "%"
sq = "SELECT Member.UserID, Member.CompanyName, Member.CompanyLocation, Member.BusinessType, Contacts.ContactName, Contacts.ContactTitle, Contacts.Responsibilities, Contacts.NotInterested, Contacts.Interested, Contacts.Preferred FROM Member INNER JOIN Contacts ON Member.UserID = Contacts.UserID WHERE Member.CompanyName LIKE '" & WhereClause & "'"
MyDb.dbColor = "4,auto,lightblue"
MyDb.dbGridtabletag = "border=4 cellpadding=4 cellspacing=4"
MyDb.dbFormtabletag = "border=4 cellpadding=4 cellspacing=4"
MyDb.dbMode = "both"
MyDb.dbFormMemo = "10 x 75,Contacts.Responsibilities, Contacts.NotInterested, Contacts.Interested"
MyDb.dbSQL = sq
MyDb.dbImageDir="/Aspdb/images/"
MyDb.dbNavigationItem="top, bottom, next, prev"
MyDb.dbNavigationIcon="std"
MyDb.dbButtonAnchor = false
MyDb.dbSuppressMsg = true
MyDb.dbSelectFrom = True
MyDb.dbGridHideFlds = "0,6,7,8,9"
MyDb.dbFormHideFlds = "0,6,7,8"
MyDb.dbExportFlds = "Member.UserID, Member.CompanyName,
Contacts.ContactName"
MyDb.dbNameMap = "Member.CompanyName, Company Name,; Member.CompanyLocation, Company Location,; Member.BusinessType, Business Type,; Contacts.ContactName, Contact Name,; Contacts.ContactTitle, Title,; Contacts.Preferred, Method of Contact,; Contacts.Responsibilities, Purchasing Responsibilities,; Contacts.NotInterested, Not Interested - Don't Contact Us,; Contacts.Interested, May Be Interested (See Method of Contact Above), Align = Center; Span=2"
MyDb.ASPdbFree
RECS = MyDB.dbRecordCount
%>
In a separate asp file:
<%
Response.write("<P>You selected:<BR>"
Response.write("Company Name: " & Session("ASPdb_100_Member.CompanyName")
Response.write("<BR>"
Response.write("Contact Name: " & Session("ASPdb_100_Contacts.ContactName")
Response.write("<BR>"
%>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|