Avatar billede jmc Nybegynder
26. september 2001 - 08:56 Der er 8 kommentarer og
1 løsning

Could not use \'(unknown)\'; file already in use. ???

fejlen er:

Microsoft OLE DB Provider for ODBC Drivers error \'80004005\'

[Microsoft][ODBC Microsoft Access Driver] Could not use \'(unknown)\'; file already in use.

/indhold.asp, line 21

linie 21:
set rs_menu = Server.CreateObject(\"ADODB.Recordset\")
(linie 21) rs_menu.ActiveConnection = MM_data_STRING
rs_menu.Source = \"SELECT *  FROM hent_emner_tbl\"


Min connection string:

MM_data_STRING = \"Driver={Microsoft Access Driver (*.mdb)};DBQ=d:\\usr\\www\\blabla\\data\"

Hvad man være galt?
Avatar billede nordclc Nybegynder
26. september 2001 - 09:00 #1
Prøv at tilføje .mdb på dit database:

MM_data_STRING = \"Driver={Microsoft Access Driver (*.mdb)};DBQ=d:\\usr\\www\\blabla\\data.mdb\"

//Claus

Avatar billede jmc Nybegynder
26. september 2001 - 09:04 #2
Det giver da et resultat!!

men så rykker den til linie 11:

Provider error \'80004005\'
Unspecified error
/indhold.asp, line 11

som ser sådan ud:
rs_artikel.ActiveConnection = MM_data_STRING
Avatar billede nordclc Nybegynder
26. september 2001 - 09:05 #3
Må jeg ikke se hele koden?

//Claus
Avatar billede jmc Nybegynder
26. september 2001 - 09:09 #4

Hvis du kan få noget ud af dette. (udført i dreamweaver ultradev) LOGIN giver fejl 31 login scriptet er nederst efter -*****

<%@LANGUAGE=\"VBSCRIPT\"%>
<!--#include file=\"Connections/data.asp\" -->

<%
Dim rs_artikel__MMColParam
rs_artikel__MMColParam = \"1\"
if (Request.QueryString(\"gruppe\") <> \"\") then rs_artikel__MMColParam = Request.QueryString(\"gruppe\")
%>
<%
set rs_artikel = Server.CreateObject(\"ADODB.Recordset\")
rs_artikel.ActiveConnection = MM_data_STRING
rs_artikel.Source = \"SELECT * FROM hent_udgivede_artikler WHERE gruppe = \'\" + Replace(rs_artikel__MMColParam, \"\'\", \"\'\'\") + \"\'\"
rs_artikel.CursorType = 0
rs_artikel.CursorLocation = 2
rs_artikel.LockType = 3
rs_artikel.Open()
rs_artikel_numRows = 0
%>
<%
set rs_menu = Server.CreateObject(\"ADODB.Recordset\")
rs_menu.ActiveConnection = MM_data_STRING
rs_menu.Source = \"SELECT *  FROM hent_udgivede_emner\"
rs_menu.CursorType = 0
rs_menu.CursorLocation = 2
rs_menu.LockType = 3
rs_menu.Open()
rs_menu_numRows = 0
%>
<%
Dim rs_gruppe__MMColParam
rs_gruppe__MMColParam = \"1\"
if (Request.QueryString(\"emne_id\") <> \"\") then rs_gruppe__MMColParam = Request.QueryString(\"emne_id\")
%>
<%
set rs_gruppe = Server.CreateObject(\"ADODB.Recordset\")
rs_gruppe.ActiveConnection = MM_data_STRING
rs_gruppe.Source = \"SELECT * FROM hent_emner_og_grupper WHERE emne_id = \" + Replace(rs_gruppe__MMColParam, \"\'\", \"\'\'\") + \" ORDER BY gruppe ASC\"
rs_gruppe.CursorType = 0
rs_gruppe.CursorLocation = 2
rs_gruppe.LockType = 3
rs_gruppe.Open()
rs_gruppe_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
rs_menu_numRows = rs_menu_numRows + Repeat1__numRows
%>
<%
Dim Repeat2__numRows
Repeat2__numRows = -1
Dim Repeat2__index
Repeat2__index = 0
rs_gruppe_numRows = rs_gruppe_numRows + Repeat2__numRows
%>
<%
Dim Repeat3__numRows
Repeat3__numRows = -1
Dim Repeat3__index
Repeat3__index = 0
rs_artikel_numRows = rs_artikel_numRows + Repeat3__numRows
%>
<%
\' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

\' create the list of parameters which should not be maintained
MM_removeList = \"&index=\"
If (MM_paramName <> \"\") Then MM_removeList = MM_removeList & \"&\" & MM_paramName & \"=\"
MM_keepURL=\"\":MM_keepForm=\"\":MM_keepBoth=\"\":MM_keepNone=\"\"

\' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
  NextItem = \"&\" & Item & \"=\"
  If (InStr(1,MM_removeList,NextItem,1) = 0) Then
    MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
  End If
Next

\' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
  NextItem = \"&\" & Item & \"=\"
  If (InStr(1,MM_removeList,NextItem,1) = 0) Then
    MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
  End If
Next

\' create the Form + URL string and remove the intial \'&\' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> \"\") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> \"\")  Then MM_keepURL  = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> \"\") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)

\' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
  If (firstItem <> \"\") Then
    MM_joinChar = \"&\"
  Else
    MM_joinChar = \"\"
  End If
End Function
%>
<html>
<head>
<title>MMuser</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
<script language=\"JavaScript\">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body bgcolor=\"#FFFFFF\" text=\"#000000\">
<table width=\"700\" border=\"0\" cellspacing=\"0\" cellpadding=\"10\">
  <tr bgcolor=\"#CCCCCC\">
    <td valign=\"top\">&nbsp;</td>
    <td valign=\"top\">&nbsp;</td>
    <td>
      <div align=\"right\">
        <%
    if request.cookies(\"login\")<> \"\" then
        Response.write(\"<a href=\"\"se_emner.asp\"\">[se emner]</a> <a href=\"\"se_grupper.asp\"\">[se grupper]</a> <a href=\"\"logout.asp\"\">[log ud]</a>\")
    end if
    %>
      </div>
    </td>
  </tr>
  <tr>
    <td valign=\"top\">
      <%
While ((Repeat1__numRows <> 0) AND (NOT rs_menu.EOF))
%>
      <a href=\"indhold.asp?<%= MM_keepNone & MM_joinChar(MM_keepNone) & \"emne_id=\" & rs_menu.Fields.Item(\"emne_id\").Value %>\"><%=(rs_menu.Fields.Item(\"emne\").Value)%></a><br>
      <%
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  rs_menu.MoveNext()
Wend
%>
    </td>
    <td valign=\"top\">
      <%
While ((Repeat2__numRows <> 0) AND (NOT rs_gruppe.EOF))
%>
      <A HREF=\"indhold.asp?emne_id=<%=  Request.QueryString(\"emne_id\")  & \"&gruppe=\" & rs_gruppe.Fields.Item(\"gruppe\").Value %>\"><%=(rs_gruppe.Fields.Item(\"gruppe\").Value)%></A> <BR>
      <%
  Repeat2__index=Repeat2__index+1
  Repeat2__numRows=Repeat2__numRows-1
  rs_gruppe.MoveNext()
Wend
%>
    </td>
    <td width=\"400\">
      <%
While ((Repeat3__numRows <> 0) AND (NOT rs_artikel.EOF))
%>
      <b><a href=\"#\" onClick=\"MM_openBrWindow(\'artikel.asp?<%= MM_keepNone & MM_joinChar(MM_keepNone) & \"artikel_id=\" & rs_artikel.Fields.Item(\"artikel_id\").Value %>\',\'lang\',\'width=500,height=500\')\"><%=(rs_artikel.Fields.Item(\"overskrift\").Value)%></a></b> <font size=\"2\">[online:<%=(rs_artikel.Fields.Item(\"broadcast\").Value)%>]</font>
      <%
    if request.cookies(\"login\")<> \"\" then
        Response.write(\"<a href=\"\"rediger_artikel.asp?\" & MM_keepNone & \"artikel_id=\" & rs_artikel.Fields.Item(\"artikel_id\").Value & \"\"\">[edit]</a>\")
    end if
    %>
      <br>
      <br>
      <%=(rs_artikel.Fields.Item(\"kort_beskrivelse\").Value)%>
      <P>
        <%
  Repeat3__index=Repeat3__index+1
  Repeat3__numRows=Repeat3__numRows-1
  rs_artikel.MoveNext()
Wend
%>
    </td>
  </tr>
</table>
<p>&nbsp;</p>
</body>
</html>
<%
rs_artikel.Close()
%>
<%
rs_menu.Close()
%>
<%
rs_gruppe.Close()
%>



*********************
<%@LANGUAGE=\"VBSCRIPT\"%>
<!--#include file=\"Connections/data.asp\" -->
<%
set rs_users = Server.CreateObject(\"ADODB.Recordset\")
rs_users.ActiveConnection = MM_data_STRING
rs_users.Source = \"SELECT * FROM tbl_users\"
rs_users.CursorType = 0
rs_users.CursorLocation = 2
rs_users.LockType = 3
rs_users.Open()
rs_users_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
rs_users_numRows = rs_users_numRows + Repeat1__numRows
%>
<%
\' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables(\"URL\")
If Request.QueryString<>\"\" Then MM_LoginAction = MM_LoginAction + \"?\" + Request.QueryString
MM_valUsername=CStr(Request.Form(\"txtbrugernavn\"))
If MM_valUsername <> \"\" Then
  MM_fldUserAuthorization=\"username\"
  MM_redirectLoginSuccess=\"indhold.asp\"
  MM_redirectLoginFailed=\"noaccess.asp\"
  MM_flag=\"ADODB.Recordset\"
  set MM_rsUser = Server.CreateObject(MM_flag)
  MM_rsUser.ActiveConnection = MM_data_STRING
  MM_rsUser.Source = \"SELECT username, password\"
  If MM_fldUserAuthorization <> \"\" Then MM_rsUser.Source = MM_rsUser.Source & \",\" & MM_fldUserAuthorization
  MM_rsUser.Source = MM_rsUser.Source & \" FROM tbl_users WHERE username=\'\" & MM_valUsername &\"\' AND password=\'\" & CStr(Request.Form(\"txtpassword\")) & \"\'\"
  MM_rsUser.CursorType = 0
  MM_rsUser.CursorLocation = 2
  MM_rsUser.LockType = 3
  MM_rsUser.Open
  If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
    \' username and password match - this is a valid user
    response.cookies(\"login\") = MM_valUsername
    If (MM_fldUserAuthorization <> \"\") Then
      Session(\"MM_UserAuthorization\") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
    Else
      Session(\"MM_UserAuthorization\") = \"\"
    End If
    if CStr(Request.QueryString(\"accessdenied\")) <> \"\" And false Then
      MM_redirectLoginSuccess = Request.QueryString(\"accessdenied\")
    End If
    MM_rsUser.Close
    Response.Redirect(MM_redirectLoginSuccess)
  End If
  MM_rsUser.Close
  Response.Redirect(MM_redirectLoginFailed)
End If
%>
<html>
<head>
<title>Login</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
<link rel=\"stylesheet\" href=\"css.css\" type=\"text/css\">
</head>
<body bgcolor=\"#FFFFFF\" text=\"#000000\" onload=\"f=document.login.txtbrugernavn;f.focus();f.select();\">
<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"100%\" align=\"center\">
  <tr>
    <td valign=\"middle\">
      <table border=\"1\" cellspacing=\"0\" cellpadding=\"10\" align=\"center\" bordercolor=\"#999999\">
        <tr>
          <td class=\"overskrifter_sort\" bgcolor=\"#CCCCCC\" bordercolor=\"#CCCCCC\">
            <div align=\"center\"><span class=\"overskrifter_sort\">ADMIN</span><br>
              <br>
              <%
While ((Repeat1__numRows <> 0) AND (NOT rs_users.EOF))
%>
              <a href=\"<%=(rs_users.Fields.Item(\"email\").Value)%>\"><%=(rs_users.Fields.Item(\"fornavne\").Value)%>&nbsp;<%=(rs_users.Fields.Item(\"efternavn\").Value)%></a>
              <%
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  rs_users.MoveNext()
Wend
%>
            </div>
          </td>
        </tr>
        <tr>
          <td bgcolor=\"#CCCCCC\" bordercolor=\"#CCCCCC\">
            <form name=\"login\" method=\"post\" action=\"<%=MM_LoginAction%>\">
              <p class=\"formknap\" align=\"center\"><span class=\"tekstfelter\">brugernavn:
                </span><br>
                <input type=\"text\" name=\"txtbrugernavn\" class=\"formfelter\">
                <br>
                <span class=\"tekstfelter\">adgangskode: </span><br>
                <input type=\"password\" name=\"txtpassword\" class=\"formfelter\">
                <br>
                <br>
                <input type=\"submit\" name=\"Submit\" value=\"login\" class=\"formknap\">
              </p>
            </form>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>
<%
rs_users.Close()
%>
Avatar billede jmc Nybegynder
26. september 2001 - 09:10 #5
sorry login giver fejl:

Microsoft OLE DB Provider for ODBC Drivers error \'80004005\'

[Microsoft][ODBC Microsoft Access Driver] Could not use \'(unknown)\'; file already in use.

/login.asp, line 31

Avatar billede nordclc Nybegynder
26. september 2001 - 09:12 #6
Nu har du ikke access åben hvor du står og holder på databasen vel;o) ?
Avatar billede jmc Nybegynder
26. september 2001 - 15:06 #7
nej, det er min provider!
Avatar billede jmc Nybegynder
26. september 2001 - 15:18 #8
dette script virker fint og kan godt opdatere databasen ????? Min provider forstår heller ingen ting af hvad der sker!

<%@LANGUAGE=\"VBSCRIPT\"%>
<!--#include file=\"Connections/data.asp\" -->
<%
\' *** Edit Operations: declare variables

MM_editAction = CStr(Request(\"URL\"))
If (Request.QueryString <> \"\") Then
  MM_editAction = MM_editAction & \"?\" & Request.QueryString
End If

\' boolean to abort record edit
MM_abortEdit = false

\' query string to execute
MM_editQuery = \"\"
%>
<%
\' *** Insert Record: set variables

If (CStr(Request(\"MM_insert\")) <> \"\") Then

  MM_editConnection = MM_data_STRING
  MM_editTable = \"tbl_gruppe\"
  MM_editRedirectUrl = \"se_emner.asp\"
  MM_fieldsStr  = \"emne|value\"
  MM_columnsStr = \"gruppe|\',none,\'\'\"

  \' create the MM_fields and MM_columns arrays
  MM_fields = Split(MM_fieldsStr, \"|\")
  MM_columns = Split(MM_columnsStr, \"|\")
 
  \' set the form values
  For i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_fields(i+1) = CStr(Request.Form(MM_fields(i)))
  Next

  \' append the query string to the redirect URL
  If (MM_editRedirectUrl <> \"\" And Request.QueryString <> \"\") Then
    If (InStr(1, MM_editRedirectUrl, \"?\", vbTextCompare) = 0 And Request.QueryString <> \"\") Then
      MM_editRedirectUrl = MM_editRedirectUrl & \"?\" & Request.QueryString
    Else
      MM_editRedirectUrl = MM_editRedirectUrl & \"&\" & Request.QueryString
    End If
  End If

End If
%>
<%
\' *** Insert Record: construct a sql insert statement and execute it

If (CStr(Request(\"MM_insert\")) <> \"\") Then

  \' create the sql insert statement
  MM_tableValues = \"\"
  MM_dbValues = \"\"
  For i = LBound(MM_fields) To UBound(MM_fields) Step 2
    FormVal = MM_fields(i+1)
    MM_typeArray = Split(MM_columns(i+1),\",\")
    Delim = MM_typeArray(0)
    If (Delim = \"none\") Then Delim = \"\"
    AltVal = MM_typeArray(1)
    If (AltVal = \"none\") Then AltVal = \"\"
    EmptyVal = MM_typeArray(2)
    If (EmptyVal = \"none\") Then EmptyVal = \"\"
    If (FormVal = \"\") Then
      FormVal = EmptyVal
    Else
      If (AltVal <> \"\") Then
        FormVal = AltVal
      ElseIf (Delim = \"\'\") Then  \' escape quotes
        FormVal = \"\'\" & Replace(FormVal,\"\'\",\"\'\'\") & \"\'\"
      Else
        FormVal = Delim + FormVal + Delim
      End If
    End If
    If (i <> LBound(MM_fields)) Then
      MM_tableValues = MM_tableValues & \",\"
      MM_dbValues = MM_dbValues & \",\"
    End if
    MM_tableValues = MM_tableValues & MM_columns(i)
    MM_dbValues = MM_dbValues & FormVal
  Next
  MM_editQuery = \"insert into \" & MM_editTable & \" (\" & MM_tableValues & \") values (\" & MM_dbValues & \")\"

  If (Not MM_abortEdit) Then
    \' execute the insert
    Set MM_editCmd = Server.CreateObject(\"ADODB.Command\")
    MM_editCmd.ActiveConnection = MM_editConnection
    MM_editCmd.CommandText = MM_editQuery
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close

    If (MM_editRedirectUrl <> \"\") Then
      Response.Redirect(MM_editRedirectUrl)
    End If
  End If

End If
%>
<%
set rs_gruppe = Server.CreateObject(\"ADODB.Recordset\")
rs_gruppe.ActiveConnection = MM_data_STRING
rs_gruppe.Source = \"SELECT * FROM tbl_gruppe\"
rs_gruppe.CursorType = 0
rs_gruppe.CursorLocation = 2
rs_gruppe.LockType = 3
rs_gruppe.Open()
rs_gruppe_numRows = 0
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
</head>
<body bgcolor=\"#FFFFFF\" text=\"#000000\">
<form method=\"POST\" action=\"<%=MM_editAction%>\" name=\"form1\">
  <table align=\"center\">
    <tr valign=\"baseline\">
      <td nowrap align=\"right\"> Ny gruppe:</td>
      <td>
        <input type=\"text\" name=\"emne\" value=\"\" size=\"32\">
      </td>
    </tr>
    <tr valign=\"baseline\">
      <td nowrap align=\"right\">&nbsp;</td>
      <td>
        <input type=\"submit\" value=\"tilf&oslash;j\">
      </td>
    </tr>
  </table>
  <input type=\"hidden\" name=\"MM_insert\" value=\"true\">
</form>
<p>&nbsp;</p>
</body>
</html>
<%
rs_gruppe.Close()
%>

Avatar billede jmc Nybegynder
26. september 2001 - 15:30 #9
Den giver følgende fejl:

www.mmuser.dk/Clipboard.gif

(jeg lukker dette og siger tak for at du forsøgte at hjælpe!) ;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

IT-JOB

Forsvarsministeriets Materiel- og Indkøbsstyrelse

Sektionschef til Cyber Security Guidance ved Cyberdivisionen i Forsvaret

Netcompany A/S

IT Consultant

Politiets Efterretningstjeneste

AI/ML udvikler i PET

Forsvarsministeriets Materiel- og Indkøbsstyrelse

Ingeniør til Satellitkommunikation