Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access and ASP VBScript

Status
Not open for further replies.

sanjs

Technical User
Mar 2, 2003
28
GB
Hi,

I have a few questions:

1. When I try to MS Access Database Utilites > Compact and Repair, I get a
message:

You tried to open a database that is already open exclusively by user
'admin' on machine SSHAH.
Try again when the database is available.

2. Is there a limit to the number of users at a time that can insert a record into a database?

3. I have created a form with 42 values that are inserted into the Access DB
but on sumbmit I get this message:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Number of query values and
destination fields are not the same.


Here's my code:

<%
' *** Insert Record: set variables

If (CStr(Request(&quot;MM_insert&quot;)) = &quot;form1&quot;) Then

MM_editConnection = MM_login_STRING
MM_editTable = &quot;quotes&quot;
MM_editRedirectUrl = &quot;confirm.asp&quot;
MM_fieldsStr =
&quot;o1|value|o26|value|o2|value|o27|value|o3|value|o28|value|o4|value|o29|value
|o5|value|o30|value|o6|value|o31|value|o7|value|o32|value|o8|value|o33|value
|o17|value|o9|value|o34|value|o10|value|o35|value|o11|value|o36|value|o12|va
lue|o37|value|o13|value|o38|value|o14|value|o39|value|o15|value|o40|value|o1
8|value|o20|value|username|value|o19|value&quot;
MM_columnsStr =
&quot;o1|',none,''|o26|none,none,NULL|o2|',none,''|o27|none,none,NULL|o3|',none,'
'|o28|none,none,NULL|o4|',none,''|o29|none,none,NULL|o5|',none,''|o30|none,n
one,NULL|o6|',none,''|o31|none,none,NULL|o7|',none,''|o32|none,none,NULL|o8|
',none,''|o33|none,none,NULL|o17|none,none,NULL|o9|',none,''|o34|none,none,N
ULL|o10|',none,''|o35|none,none,NULL|o11|',none,''|o36|none,none,NULL|o12|',
none,''|o37|none,none,NULL|o13|',none,''|o38|none,none,NULL|o14|',none,''|o3
9|none,none,NULL|o15|',none,''|o40|none,none,NULL|o18|none,none,NULL|o20|non
e,none,NULL|username|',none,''|o19|none,none,NULL&quot;

' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, &quot;|&quot;)
MM_columns = Split(MM_columnsStr, &quot;|&quot;)

' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
Next

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

End If
%>

I have formatted my some of my requested variables:
value=<%= FormatCurrency( Request(&quot;o19&quot;) , 2, -2, -2, -2) %>
readonly=&quot;true&quot;>
but this should not be a problem should it?

I've checked and rechecked everything but can't seem to sort the problem -
has anyone seen this?

Regards,

Sanjay
 
See the FAQ: faq333-3048

Look at Reference 8 and 10

-pete

 
Thanks Pete, useful information.

Sanjay
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top