Results 1 to 4 of 4

Thread: Export variable problem

  1. #1
    Greg Ivins Guest

    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(&#34;ASPdb.Free&#34
    Mydb.dbUnit = 100
    MyDb.dbMDB = Server.MapPath(&#34;CCU.mdb&#34

    TmpRemember = Request(&#34;Company&#34
    TmpRemember = Replace(TmpRemember,&#34;&#39;&#34;,&#34;&#39;&#39 ;&#34

    if (TmpRemember <> &#34;&#34 then
    Session(&#34;NameRemember&#34 = TmpRemember
    MyDb.dbReset(100)
    end if

    WhereClause = Session(&#34;NameRemember&#34 + &#34;%&#34;

    sq = &#34;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 &#39;&#34; & WhereClause & &#34;&#39;&#34;

    MyDb.dbColor = &#34;4,auto,lightblue&#34;
    MyDb.dbGridtabletag = &#34;border=4 cellpadding=4 cellspacing=4&#34;
    MyDb.dbFormtabletag = &#34;border=4 cellpadding=4 cellspacing=4&#34;
    MyDb.dbMode = &#34;both&#34;
    MyDb.dbFormMemo = &#34;10 x 75,Contacts.Responsibilities, Contacts.NotInterested, Contacts.Interested&#34;
    MyDb.dbSQL = sq
    MyDb.dbImageDir=&#34;/Aspdb/images/&#34;
    MyDb.dbNavigationItem=&#34;top, bottom, next, prev&#34;
    MyDb.dbNavigationIcon=&#34;std&#34;
    MyDb.dbButtonAnchor = false
    MyDb.dbSuppressMsg = true
    MyDb.dbSelectFrom = True
    MyDb.dbGridHideFlds = &#34;0,6,7,8,9&#34;
    MyDb.dbFormHideFlds = &#34;0,6,7,8&#34;
    MyDb.dbExportFlds = &#34;Member.UserID, Member.CompanyName,
    Contacts.ContactName&#34;
    MyDb.dbNameMap = &#34;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&#39;t Contact Us,; Contacts.Interested, May Be Interested (See Method of Contact Above), Align = Center; Span=2&#34;
    MyDb.ASPdbFree
    RECS = MyDB.dbRecordCount
    %>

    In a separate asp file:

    <%
    Response.write(&#34;<P>You selected:<BR>&#34
    Response.write(&#34;Company Name: &#34; & Session(&#34;ASPdb_100_Member.CompanyName&#34)
    Response.write(&#34;<BR>&#34
    Response.write(&#34;Contact Name: &#34; & Session(&#34;ASPdb_100_Contacts.ContactName&#34)
    Response.write(&#34;<BR>&#34
    %>




  2. #2
    Guest

    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 = &#34;0, 1,4#34;

    In your separate asp file:

    <%
    Response.write(&#34;<P>You selected:<BR>&#34
    Response.write(&#34;Company Name: &#34; & Session(&#34;ASPdb_1_CompanyName&#34)
    Response.write(&#34;<BR>&#34
    Response.write(&#34;Contact Name: &#34; & Session(&#34;ASPdb_4_Contacts.ContactName&#34)
    Response.write(&#34;<BR>&#34
    %>




    ------------
    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&#39;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(&#34;ASPdb.Free&#34
    Mydb.dbUnit = 100
    MyDb.dbMDB = Server.MapPath(&#34;CCU.mdb&#34

    TmpRemember = Request(&#34;Company&#34
    TmpRemember = Replace(TmpRemember,&#34;&#39;&#34;,&#34;&#39;&#39 ;&#34

    if (TmpRemember <> &#34;&#34 then
    Session(&#34;NameRemember&#34 = TmpRemember
    MyDb.dbReset(100)
    end if

    WhereClause = Session(&#34;NameRemember&#34 + &#34;%&#34;

    sq = &#34;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 &#39;&#34; & WhereClause & &#34;&#39;&#34;

    MyDb.dbColor = &#34;4,auto,lightblue&#34;
    MyDb.dbGridtabletag = &#34;border=4 cellpadding=4 cellspacing=4&#34;
    MyDb.dbFormtabletag = &#34;border=4 cellpadding=4 cellspacing=4&#34;
    MyDb.dbMode = &#34;both&#34;
    MyDb.dbFormMemo = &#34;10 x 75,Contacts.Responsibilities, Contacts.NotInterested, Contacts.Interested&#34;
    MyDb.dbSQL = sq
    MyDb.dbImageDir=&#34;/Aspdb/images/&#34;
    MyDb.dbNavigationItem=&#34;top, bottom, next, prev&#34;
    MyDb.dbNavigationIcon=&#34;std&#34;
    MyDb.dbButtonAnchor = false
    MyDb.dbSuppressMsg = true
    MyDb.dbSelectFrom = True
    MyDb.dbGridHideFlds = &#34;0,6,7,8,9&#34;
    MyDb.dbFormHideFlds = &#34;0,6,7,8&#34;
    MyDb.dbExportFlds = &#34;Member.UserID, Member.CompanyName,
    Contacts.ContactName&#34;
    MyDb.dbNameMap = &#34;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&#39;t Contact Us,; Contacts.Interested, May Be Interested (See Method of Contact Above), Align = Center; Span=2&#34;
    MyDb.ASPdbFree
    RECS = MyDB.dbRecordCount
    %>

    In a separate asp file:

    <%
    Response.write(&#34;<P>You selected:<BR>&#34
    Response.write(&#34;Company Name: &#34; & Session(&#34;ASPdb_100_Member.CompanyName&#34)
    Response.write(&#34;<BR>&#34
    Response.write(&#34;Contact Name: &#34; & Session(&#34;ASPdb_100_Contacts.ContactName&#34)
    Response.write(&#34;<BR>&#34
    %>




  3. #3
    GV Guest

    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 = &#34;0, 1,4#34;

    In your separate asp file:

    <%
    Response.write(&#34;<P>You selected:<BR>&#34
    Response.write(&#34;Company Name: &#34; & Session(&#34;ASPdb_1_CompanyName&#34)
    Response.write(&#34;<BR>&#34
    Response.write(&#34;Contact Name: &#34; & Session(&#34;ASPdb_4_Contacts.ContactName&#34)
    Response.write(&#34;<BR>&#34
    %>




    ------------
    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&#39;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(&#34;ASPdb.Free&#34
    Mydb.dbUnit = 100
    MyDb.dbMDB = Server.MapPath(&#34;CCU.mdb&#34

    TmpRemember = Request(&#34;Company&#34
    TmpRemember = Replace(TmpRemember,&#34;&#39;&#34;,&#34;&#39;&#39 ;&#34

    if (TmpRemember <> &#34;&#34 then
    Session(&#34;NameRemember&#34 = TmpRemember
    MyDb.dbReset(100)
    end if

    WhereClause = Session(&#34;NameRemember&#34 + &#34;%&#34;

    sq = &#34;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 &#39;&#34; & WhereClause & &#34;&#39;&#34;

    MyDb.dbColor = &#34;4,auto,lightblue&#34;
    MyDb.dbGridtabletag = &#34;border=4 cellpadding=4 cellspacing=4&#34;
    MyDb.dbFormtabletag = &#34;border=4 cellpadding=4 cellspacing=4&#34;
    MyDb.dbMode = &#34;both&#34;
    MyDb.dbFormMemo = &#34;10 x 75,Contacts.Responsibilities, Contacts.NotInterested, Contacts.Interested&#34;
    MyDb.dbSQL = sq
    MyDb.dbImageDir=&#34;/Aspdb/images/&#34;
    MyDb.dbNavigationItem=&#34;top, bottom, next, prev&#34;
    MyDb.dbNavigationIcon=&#34;std&#34;
    MyDb.dbButtonAnchor = false
    MyDb.dbSuppressMsg = true
    MyDb.dbSelectFrom = True
    MyDb.dbGridHideFlds = &#34;0,6,7,8,9&#34;
    MyDb.dbFormHideFlds = &#34;0,6,7,8&#34;
    MyDb.dbExportFlds = &#34;Member.UserID, Member.CompanyName,
    Contacts.ContactName&#34;
    MyDb.dbNameMap = &#34;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&#39;t Contact Us,; Contacts.Interested, May Be Interested (See Method of Contact Above), Align = Center; Span=2&#34;
    MyDb.ASPdbFree
    RECS = MyDB.dbRecordCount
    %>

    In a separate asp file:

    <%
    Response.write(&#34;<P>You selected:<BR>&#34
    Response.write(&#34;Company Name: &#34; & Session(&#34;ASPdb_100_Member.CompanyName&#34)
    Response.write(&#34;<BR>&#34
    Response.write(&#34;Contact Name: &#34; & Session(&#34;ASPdb_100_Contacts.ContactName&#34)
    Response.write(&#34;<BR>&#34
    %>




  4. #4
    Mark Guest

    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&#39;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(&#34;ASPdb.Free&#34
    Mydb.dbUnit = 100
    MyDb.dbMDB = Server.MapPath(&#34;CCU.mdb&#34

    TmpRemember = Request(&#34;Company&#34
    TmpRemember = Replace(TmpRemember,&#34;&#39;&#34;,&#34;&#39;&#39 ;&#34

    if (TmpRemember <> &#34;&#34 then
    Session(&#34;NameRemember&#34 = TmpRemember
    MyDb.dbReset(100)
    end if

    WhereClause = Session(&#34;NameRemember&#34 + &#34;%&#34;

    sq = &#34;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 &#39;&#34; & WhereClause & &#34;&#39;&#34;

    MyDb.dbColor = &#34;4,auto,lightblue&#34;
    MyDb.dbGridtabletag = &#34;border=4 cellpadding=4 cellspacing=4&#34;
    MyDb.dbFormtabletag = &#34;border=4 cellpadding=4 cellspacing=4&#34;
    MyDb.dbMode = &#34;both&#34;
    MyDb.dbFormMemo = &#34;10 x 75,Contacts.Responsibilities, Contacts.NotInterested, Contacts.Interested&#34;
    MyDb.dbSQL = sq
    MyDb.dbImageDir=&#34;/Aspdb/images/&#34;
    MyDb.dbNavigationItem=&#34;top, bottom, next, prev&#34;
    MyDb.dbNavigationIcon=&#34;std&#34;
    MyDb.dbButtonAnchor = false
    MyDb.dbSuppressMsg = true
    MyDb.dbSelectFrom = True
    MyDb.dbGridHideFlds = &#34;0,6,7,8,9&#34;
    MyDb.dbFormHideFlds = &#34;0,6,7,8&#34;
    MyDb.dbExportFlds = &#34;Member.UserID, Member.CompanyName,
    Contacts.ContactName&#34;
    MyDb.dbNameMap = &#34;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&#39;t Contact Us,; Contacts.Interested, May Be Interested (See Method of Contact Above), Align = Center; Span=2&#34;
    MyDb.ASPdbFree
    RECS = MyDB.dbRecordCount
    %>

    In a separate asp file:

    <%
    Response.write(&#34;<P>You selected:<BR>&#34
    Response.write(&#34;Company Name: &#34; & Session(&#34;ASPdb_100_Member.CompanyName&#34)
    Response.write(&#34;<BR>&#34
    Response.write(&#34;Contact Name: &#34; & Session(&#34;ASPdb_100_Contacts.ContactName&#34)
    Response.write(&#34;<BR>&#34
    %>




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •