Avatar billede mcclaud Nybegynder
19. oktober 2008 - 18:34 Der er 9 kommentarer og
1 løsning

FrontPage resultat-database, tilfældige poster

Hej alle

Jeg har en FrontPage-database, som jeg gerne vil have, at computeren trækker 5 tilfældige poster ud. Hvordan gør jeg det?  :o)

<% end if %>
<%
fp_sQry="SELECT * FROM ""titles_lme"" WHERE (artist =  '::artist::') ORDER BY title ASC"
fp_sDefault="artist="
fp_sNoRecords="<tr><td colspan=14 align=""LEFT"" width=""100%""></td></tr>"
fp_sDataConn="lme3db2"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=3
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&artist=200&title=200&intelli_title=200&value=5&new=5&group=200&time=200&tempo=200&year=200&decade=200&extra1=200&extra2=200&extra3=200&featuring1=200&featuring2=200&featuring3=200&composer=200&"
fp_iDisplayCols=14
fp_fCustomQuery=False
BOTID=1
fp_iRegion=BOTID
%>
Avatar billede ldanielsen Nybegynder
21. oktober 2008 - 13:05 #1
Det er vist en forkert kategori.

Hvilken database er det? Mig bekendt er der ikke en Frontpage database, det du mener er nok at du lader Frontpage hjælpe dig med at connect'e til en database.

Find ud af hvilken database det er, og post spm. i den rigtigt kategori
Avatar billede w13 Novice
21. oktober 2008 - 19:32 #2
Måske med ORDER BY rand() men ja, det kommer an på databasen.
Avatar billede mcclaud Nybegynder
21. oktober 2008 - 20:10 #3
Det virker desværre ikke... Jeg har eksperimenteret en del med ORDER BY-delen. Det eneste, som fungerede var ORDER BY RND(). Resultatet var en sortering i tilfældig rækkefølge, men desværre altid den samme tilfældige rækkefølge. Jeg vil gerne, at de 5 udtrukne poster er forskellige ved hvert tryk.

:o)
Avatar billede arne_v Ekspert
21. oktober 2008 - 20:41 #4
proev:

fp_sQry="SELECT TOP 5 * FROM ""titles_lme"" WHERE (artist =  '::artist::') ORDER BY NEWID()"
Avatar billede mcclaud Nybegynder
21. oktober 2008 - 20:56 #5
Det virker desværre ikke med ORDER BY NEWID()...
Avatar billede w13 Novice
21. oktober 2008 - 21:16 #6
Vi skal vide, hvilken database, det drejer sig om. =)
Avatar billede mcclaud Nybegynder
21. oktober 2008 - 22:37 #7
Jeg håber, at I kan finde svaret i nedenstående kode:

<html>

<head>
<% ' FP_ASP -- ASP, der er genereret automatisk af en FrontPage-komponent. Undlad at redigere.
FP_LCID = 1030 %>
<meta http-equiv="Content-Language" content="da">
<% ' FP_ASP -- ASP, der er genereret automatisk af en FrontPage-komponent. Undlad at redigere.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>lme3</title>
<base target="_self">

<script type="text/javascript" src="applications\helpbox.js"></script>

</head>

<!--  PEL_START: Sæt værdi af refpage, skal sættes på ALLE sider, hvor refpage skal kunne læses  -->
<%
    refpage = 0
    refpage = Request("refpage") + 1
%>
<!--  PEL_SLUT: Sæt værdi af refpage  -->

<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0" background="graphics/background/background_centre.jpg">

<form BOTID="0" METHOD="POST" action="titledb2.asp">
    <input type="hidden" name="fpdbr_0_PagingMove" value="  |&lt;  ">
</form>

<p><!--webbot bot="HTMLMarkup" startspan --><SCRIPT language=JavaScript1.2>
function disableselect(e){
return false
}
function reEnable(){
return true
}
document.onselectstart=new Function ("return false")
</SCRIPT><!--webbot bot="HTMLMarkup" endspan --></p>

<table border="0" width="100" cellspacing="0" cellpadding="0" height="30" id="bottom_help" style="position: absolute; left: 924px; top: 610px; z-index:0">
  <tr>
    <td>
    <a onClick="return show_hide_box(this,190,190,'2px dotted')" href="help/help_titledb.htm">
    <img border="0" src="graphics/menubuttons/bottom/menubutton_help.gif" width="100" height="30"></a></td>
  </tr>
</table>

<table border="0" width="1024" cellspacing="0" cellpadding="0" height="30" id="bottom_all" style="position: absolute; top: 610px; left: 0px; width: 1024px; height: 30px; z-index: -1" align="left">
  <tr>
    <td>
    <!--webbot bot="Include" U-Include="applications/bottom_backbutton_laub.htm" TAG="BODY" --></td>
  </tr>
</table>

<table border="0" width="512" cellpadding="0" style="font-size: 1pt; border-collapse: collapse" height="15" id="table1">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<table cellpadding="0" style="font-family: Barmeno Regular; font-size: 12pt; font-variant: small-caps; color: #858585; font-weight: bold; border-collapse: collapse">
    <tbody>
        <!--webbot bot="DatabaseRegionStart" s-columnnames="artist,title,intelli_title,value,new,group,time,tempo,year,decade,extra1,extra2,extra3,featuring1,featuring2,featuring3,composer" s-columntypes="200,200,200,5,200,200,200,200,200,200,200,200,200,200,200,200,200" s-dataconnection="lme3db2" b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="FALSE" b-tableexpand="FALSE" b-tableheader="FALSE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="TRUE" s-recordsource="titles_lme" s-displaycolumns="artist,title,value,new,time,tempo,year,extra1,extra2,extra3,featuring1,featuring2,featuring3,composer" s-criteria="[intelli_title] CNT {intelli_title} +" s-order="[title] + [artist] +" s-sql="SELECT * FROM &quot;titles_lme&quot; WHERE (intelli_title LIKE '%::intelli_title::%') ORDER BY title ASC,artist ASC" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields="intelli_title=" s-norecordsfound i-maxrecords="0" i-groupsize="5" botid="0" u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="TBODY" preview="&lt;tr&gt;&lt;td colspan=64 bgcolor=&quot;#FFFF00&quot; width=&quot;100%&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;Dette er begyndelsen af området med databaseresultater. Denne side kan kun vises korrekt, hvis den hentes fra en webserver med en webbrowser. Det aktuelle websted er gemt på din harddisk eller på det lokale netværk.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;" startspan --><!--#include file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>Komponenten Databaseresultater på denne side kan ikke vise databaseindhold. Siden skal have et filnavn, der slutter med '.asp', og webstedet skal findes på en server, der understøtter Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM ""titles_lme"" WHERE (intelli_title LIKE '%::intelli_title::%') ORDER BY title ASC,artist ASC"
fp_sDefault="intelli_title="
fp_sNoRecords="<tr><td colspan=14 align=""LEFT"" width=""100%""></td></tr>"
fp_sDataConn="lme3db2"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=5
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&artist=200&title=200&intelli_title=200&value=5&new=200&group=200&time=200&tempo=200&year=200&decade=200&extra1=200&extra2=200&extra3=200&featuring1=200&featuring2=200&featuring3=200&composer=200&"
fp_iDisplayCols=14
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="31177" --><tr>
            <td height="35" width="20">&nbsp;</td>
            <td height="35" width="50" align="center">
            <a target="centralframe" href="artistinfodb2.asp?artist=<%=FP_FieldURL(fp_rs,"artist")%>&featuring1=<%=FP_FieldURL(fp_rs,"featuring1")%>&featuring2=<%=FP_FieldURL(fp_rs,"featuring2")%>&featuring3=<%=FP_FieldURL(fp_rs,"featuring3")%>">
            <img border="0" src="graphics/title/title_button_a.gif"></a></td>
            <td height="35" width="67" background="graphics/title/title_artist.gif">&nbsp;</td>
            <td height="35" width="725" background="graphics/title/title_background_1.gif">&nbsp;
            <font face="Barmeno Bold" style="font-size: 15pt; font-weight: 400" color="#000000">
            <!--webbot bot="DatabaseResultColumn" s-columnnames="artist,title,intelli_title,value,new,group,time,tempo,year,decade,extra1,extra2,extra3,featuring1,featuring2,featuring3,composer" s-column="artist" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;artist&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"artist")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="17815" --></font>&nbsp;&nbsp;
            <!--webbot bot="DatabaseResultColumn" s-columnnames="artist,title,intelli_title,value,new,group,time,tempo,year,decade,extra1,extra2,extra3,featuring1,featuring2,featuring3,composer" s-column="featuring1" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;featuring1&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"featuring1")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="23130" -->&nbsp;&nbsp;
            <!--webbot bot="DatabaseResultColumn" s-columnnames="artist,title,intelli_title,value,new,group,time,tempo,year,decade,extra1,extra2,extra3,featuring1,featuring2,featuring3,composer" s-column="featuring2" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;featuring2&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"featuring2")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="23258" -->&nbsp;&nbsp;
            <!--webbot bot="DatabaseResultColumn" s-columnnames="artist,title,intelli_title,value,new,group,time,tempo,year,decade,extra1,extra2,extra3,featuring1,featuring2,featuring3,composer" s-column="featuring3" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;featuring3&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"featuring3")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="23386" --></td>
            <td height="35" width="50" background="graphics/title/title_tempo.gif">&nbsp;</td>
            <td height="35" width="92" align="center" background="graphics/title/title_background_4.gif">
            <!--webbot bot="DatabaseResultColumn" s-columnnames="artist,title,intelli_title,value,new,group,time,tempo,year,decade,extra1,extra2,extra3,featuring1,featuring2,featuring3,composer" s-column="tempo" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;tempo&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"tempo")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="10350" --></td>
            <td height="35" width="20">&nbsp;</td>
        </tr>
        <tr>
            <td height="35" width="20">&nbsp;</td>
            <td height="35" width="50" align="center">
            <a target="centralframe" href="titledb2_confirm.asp?artist=<%=FP_FieldURL(fp_rs,"artist")%>&title=<%=FP_FieldURL(fp_rs,"title")%>"><img border="0" src="graphics/title/title_button_t.gif" width="50" height="35"></a></td>
            <td height="35" width="67" background="graphics/title/title_title.gif">&nbsp;</td>
            <td height="35" width="725" background="graphics/title/title_background_2.gif">&nbsp;
            <font face="Barmeno Bold" style="font-size: 15pt; font-weight: 400" color="#000000">
            <!--webbot bot="DatabaseResultColumn" s-columnnames="artist,title,intelli_title,value,new,group,time,tempo,year,decade,extra1,extra2,extra3,featuring1,featuring2,featuring3,composer" s-column="title" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;title&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"title")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="10821" --></font>&nbsp;&nbsp;
            <img border="0" src="graphics/buttons/<%=FP_FieldLink(fp_rs,"new")%>.gif" align="absmiddle"></td>
            <td height="35" width="50" background="graphics/title/title_year.gif">&nbsp;</td>
            <td height="35" width="92" align="center" background="graphics/title/title_background_5.gif">
            <!--webbot bot="DatabaseResultColumn" s-columnnames="artist,title,intelli_title,value,new,group,time,tempo,year,decade,extra1,extra2,extra3,featuring1,featuring2,featuring3,composer" s-column="year" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;year&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"year")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="7178" --></td>
            <td height="35" width="20">&nbsp;</td>
        </tr>
        <tr>
            <td height="34" width="20">&nbsp;</td>
            <td height="34" width="50" align="center" valign="bottom" background="graphics/title/title_button_v_background.gif">
            <a target="centralframe" href="versiondb2.asp?extra1=<%=FP_FieldURL(fp_rs,"extra1")%>"><img border="0" src="graphics/title/<%=FP_FieldLink(fp_rs,"extra3")%>.gif" align="middle"></a></td>
            <td height="34" width="67" background="graphics/title/title_composer.gif">&nbsp;</td>
            <td height="34" width="725" background="graphics/title/title_background_3.gif">&nbsp;
            <!--webbot bot="DatabaseResultColumn" s-columnnames="artist,title,intelli_title,value,new,group,time,tempo,year,decade,extra1,extra2,extra3,featuring1,featuring2,featuring3,composer" s-column="composer" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;composer&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"composer")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="18231" --></td>
            <td height="34" width="50" background="graphics/title/title_time.gif">&nbsp;</td>
            <td height="34" width="92" align="center" background="graphics/title/title_background_6.gif">
            <!--webbot bot="DatabaseResultColumn" s-columnnames="artist,title,intelli_title,value,new,group,time,tempo,year,decade,extra1,extra2,extra3,featuring1,featuring2,featuring3,composer" s-column="time" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;time&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"time")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="7356" --></td>
            <td height="34" width="20">&nbsp;</td>
        </tr>
        <tr>
            <td height="15" width="1024" colspan="7" style="font-size: 1pt; color: #FAFAFA">
            <p>
            <!--webbot bot="DatabaseResultColumn" s-columnnames="artist,title,intelli_title,value,new,group,time,tempo,year,decade,extra1,extra2,extra3,featuring1,featuring2,featuring3,composer" s-column="extra1" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;extra1&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"extra1")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="18249" --><!--webbot bot="DatabaseResultColumn" s-columnnames="artist,title,intelli_title,value,new,group,time,tempo,year,decade,extra1,extra2,extra3,featuring1,featuring2,featuring3,composer" s-column="extra2" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;extra2&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"extra2")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="18257" --><!--webbot bot="DatabaseResultColumn" s-columnnames="artist,title,intelli_title,value,new,group,time,tempo,year,decade,extra1,extra2,extra3,featuring1,featuring2,featuring3,composer" s-column="extra3" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;extra3&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"extra3")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="18265" --></td>
        </tr>
        <!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="5" clientside tag="TBODY" preview="&lt;tr&gt;&lt;td colspan=64 bgcolor=&quot;#FFFF00&quot; width=&quot;100%&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;Dette er slutningen af området med databaseresultater.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;TR&gt;&lt;TD VALIGN=MIDDLE COLSPAN=64&gt;&lt;NOBR&gt;&lt;INPUT TYPE=Button VALUE=&quot;  |&lt;  &quot;&gt;&lt;INPUT TYPE=Button VALUE=&quot;  &lt;  &quot;&gt;&lt;INPUT TYPE=Button VALUE=&quot;  &gt;  &quot;&gt;&lt;INPUT TYPE=Button VALUE=&quot;  &gt;|  &quot;&gt;  [1/5]&lt;/NOBR&gt;&lt;BR&gt;&lt;/td&gt;&lt;/tr&gt;" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" --></tbody>
</table>

</body>

</html>
Avatar billede arne_v Ekspert
22. oktober 2008 - 00:46 #8
Jeg gaetter paa at DB definitionen ligger i fpdblib.inc !

Den fejl meddelelse du faar kan ogsaa indikere hvilken database det er.
Avatar billede mcclaud Nybegynder
22. oktober 2008 - 07:42 #9
Sådan her ser min fpdblib.inc-fil ud:

<%

Sub FP_SetLocaleForPage
    On Error Resume Next
    Session("FP_OldCodePage") = Session.CodePage
    Session("FP_OldLCID") = Session.LCID
    Err.Clear
    if FP_CodePage <> 0 then
        Session.CodePage = FP_CodePage
        if Err.Number <> 0 then Session.CodePage = Session("FP_OldCodePage")
    end if
    Err.Clear
    if FP_LCID <> 0 then
        Session.LCID = FP_LCID
        if Err.Number <> 0 then Session.LCID = Session("FP_OldLCID")
    end if
End Sub

Sub FP_RestoreLocaleForPage
    On Error Resume Next
    if Session("FP_OldCodePage") <> 0 then
        Session.CodePage = Session("FP_OldCodePage")
    end if
    if Session("FP_OldLCID") <> 0 then
        Session.LCID = Session("FP_OldLCID")
    end if
    Err.Clear
End Sub

Function FP_HTMLEncode(str)

    FP_HTMLEncode = str
    FP_HTMLEncode = Replace(FP_HTMLEncode,"&","^^@^^")
    FP_HTMLEncode = Server.HTMLEncode(FP_HTMLEncode)
    FP_HTMLEncode = Replace(FP_HTMLEncode,"^^@^^","&")

End Function

Function FP_FieldVal(rs, fldname)

    FP_FieldVal = FP_HTMLEncode(FP_Field(rs, fldname))
    if FP_FieldVal = "" then FP_FieldVal = "&nbsp;"

End Function

Function FP_Field(rs, fldname)

    If Not IsEmpty(rs) And Not (rs Is Nothing) and Not IsNull(rs(fldname)) Then
        Select Case rs(fldname).Type
            Case 128, 204, 205 ' adBinary, adVarBinary, adLongVarBinary
                FP_Field = "[#BINARY#]"
            Case 201, 203 ' adLongVarChar, adLongVarWChar
                if rs(fldname).DefinedSize > 255 then
                    ' check for Access hyperlink fields (only absolute http links)
                    fp_strVal = rs(fldname)
                    fp_idxHash1 = InStr(LCase(fp_strVal),"#http://")
                    if fp_idxHash1 > 0 then
                        fp_idxHash2 = InStr(fp_idxHash1+1,fp_strVal,"#")
                        if fp_idxHash2 > 0 then
                            ' this is an Access hyperlink; extract the URL part
                            fp_strVal = Mid(fp_strVal,fp_idxHash1+1)
                            if Right(fp_strVal,1) = "#" then
                                fp_strVal = Left(fp_strVal,Len(fp_strVal)-1)
                            end if
                        end if
                    end if
                    FP_Field = fp_strVal
                else
                    FP_Field = rs(fldname)
                end if
            Case Else
                FP_Field = rs(fldname)
        End Select
    Else
        FP_Field = ""
    End If

End Function

Function FP_FieldHTML(rs, fldname)

    FP_FieldHTML = FP_HTMLEncode(FP_Field(rs, fldname))

End Function

Function FP_FieldURL(rs, fldname)

    FP_FieldURL = Server.URLEncode(FP_Field(rs, fldname))

End Function

Function FP_FieldLink(rs, fldname)

    FP_FieldLink = Replace(FP_Field(rs, fldname), " ", "%20")

End Function

Sub FP_OpenConnection(oConn, sAttrs, sUID, sPWD, fMSAccessReadOnly)

    Dim sTmp
    Dim sConnStr
    Dim fIsAccessDriver

    fIsAccessDriver = (InStr(LCase(sAttrs), "microsoft access driver") > 0)
    sConnStr = FP_RemoveDriverWithDSN(sAttrs)
    sTmp = sConnStr
   
    On Error Resume Next

    If fMSAccessReadOnly And fIsAccessDriver Then

        sTmp = sTmp & ";Exclusive=1;ReadOnly=1"

        Err.Clear
        oConn.Open sTmp, sUID, sPWD
        If Err.Description = "" Then Exit Sub

    End If

    Err.Clear
    oConn.Open sConnStr, sUID, sPWD

End Sub

Function FP_RemoveDriverWithDSN(sAttrs)

    FP_RemoveDriverWithDSN = sAttrs

    sDrv = "driver="
    sDSN = "dsn="
    sLC = LCase(sAttrs)
    if InStr(sLC, sDSN) < 1 then exit function

    idxFirst = InStr(sLC, sDrv)
    if idxFirst < 1 then exit function
    idxBeg = idxFirst + Len(sDrv)
    if Mid(sLC,idxBeg,1) = "{" then
        idxEnd = InStr(idxBeg, sLC, "}")
        if idxEnd > 0 and Mid(sLC,idxEnd+1,1) = ";" then
            idxEnd = idxEnd + 1
        end if
    else
        idxEnd = InStr(idxBeg, sLC, ";")
    end if
    if idxEnd < 1 then idxEnd = Len(sLC)
   
    FP_RemoveDriverWithDSN = Left(sAttrs,idxFirst-1) & Mid(sAttrs,idxEnd+1)

End Function

Sub FP_OpenRecordset(rs)
   
    On Error Resume Next
    rs.Open

End Sub

Function FP_ReplaceQuoteChars(sQry)

    Dim sIn
    Dim sOut
    Dim idx

    sIn = sQry
    sOut = ""

    idx = InStr(sIn, "%%")

    Do While (idx > 0)

        sOut = sOut & Left(sIn, idx - 1)
        sIn = Mid(sIn, idx + 2)
        if (Left(sIn,1) = "%") And (Left(sIn,2) <> "%%") then
            sIn = Mid(sIn, 2)
            sOut = sOut & "%"
        end if
        sOut = sOut & "::"

        idx = InStr(sIn, "%%")
        if idx > 0 then
            sOut = sOut & Left(sIn, idx - 1)
            sIn = Mid(sIn, idx + 2)
            sOut = sOut & "::"
            if (Left(sIn,1) = "%") And (Left(sIn,2) <> "%%") then
                sIn = Mid(sIn, 2)
                sOut = sOut & "%"
            end if
        end if
       
        idx = InStr(sIn, "%%")

    Loop

    sOut = sOut & sIn

    FP_ReplaceQuoteChars = sOut

End Function

Sub FP_Close(obj)

    On Error Resume Next

    obj.Close

End Sub

Sub FP_SetCursorProperties(rs)

    On Error Resume Next

    rs.CursorLocation = 3 ' adUseClient
    rs.CursorType = 3 ' adOpenStatic

End Sub

%>
Avatar billede mcclaud Nybegynder
26. oktober 2008 - 00:41 #10
Har selv løst problemet...  :o)
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Computerworld tilbyder specialiserede kurser i database-management

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester