Re: web form getting data to SQL Backend

Tech-Archive recommends: Fix windows errors by optimizing your registry



I did see your first response... I just don't think I know what I am doing on
this.... I did post it on another board as suggested previously. The reason
I didn't use express (although it may be good enough) is that I have over 100
users that will be connecting to this and I will be migrating the FE to CRM
before long. In the meantime I wanted it to work in SQL and everything does
except the web submission.

From the link you sent previously I had made this connection string

ConnectionString = {SQL Server Native Client 10.0}
;Server=SQL;Database=cm5final;Uid=mynewlogin;Pwd=anewpassword;

When I use this one it does not connect. Again I know I don't know what I am
doing on this and was kinda hoping for a hand held answer.

the new code looks something like this but still doesn't work.

<font size=+1 color=red><center>
<%

leadtype = request.querystring("leadtype")
orderid = request.querystring("orderid")
ip = request.querystring("ip")
source = request.querystring("source")
fname = request.querystring("fname")
lname = request.querystring("lname")
street = request.querystring("street")
city = request.querystring("city")
state = request.querystring("state")
zip = request.querystring("zip")
hphone = request.querystring("hphone")
wphone = request.querystring("wphone")
email = request.querystring("email")
debtamt = request.querystring("debtamt")
mosbehind = request.querystring("mosbehind")
contacttime = request.querystring("contacttime")
comment = request.querystring("comment")
creditor = request.querystring("creditor")
balance = request.querystring("balance")

Dim areacode
Dim timezone
If Left(hphone,1)= "(" Then areacode=Right(Left(hphone,4),3) Else
areacode=Left(hphone,3)


If hphone <> "" and fname <> "" and lname <> "" and email <> "" and debtamt
<> "" Then


ConnectionString = {SQL Server Native Client 10.0}
;Server=SQL;Database=cm5final;Uid=newlogin;Pwd=newpassword;

Set Connection = Server.CreateObject("ADODB.Connection")
Connection.Open(ConnectionString)

set rs = Server.CreateObject("ADODB.recordset")
set rs2 = Server.CreateObject("ADODB.recordset")

rs.Open "SELECT FirstName FROM Clients WHERE HomePhone = '" & hphone & "'",
Connection

If Not rs.EOF Then
Response.Write("Lead already exists. Please enter a new lead.")
Else
If fname <> "" and lname <> "" Then
rs.close
rs.open "SELECT * FROM [TZ List] WHERE [Area Code] = '" &
areacode & "'", Connection
timezone = rs("Time Zone")
sql = "INSERT INTO Clients ([Time Zones],areacode,LeadType,
customerordersaleID,IP,Source,FirstName,LastName,StreetAddress,City,State,Zip,
HomePhone,WorkPhone,Email,DebtAmount,MonthsBehind,ContactTime,Comment,
CreditorName1) VALUES ('" & timezone & "','" & areacode & "','" & leadtype &
"','" & orderid & "','" & ip & "','" & source & "','" & fname & "','" & lname
& "','" & street & "','" & city & "','" & state & "','" & zip & "','" &
hphone & "','" & wphone & "','" & email & "','" & debtamt & "','" & mosbehind
& "','" & contacttime & "','" & comment & "','" & creditor & "')"
Connection.Execute sql,recaffected
Response.Write("Lead submitted successfully!")

Else
Response.Write("Missing Information! Please complete
source, name, phone, email, debt amount and city/state or zip.")
End If
End If
rs.close
Connection.close


Else
If fname <> "" or hphone <> "" or lname <> "" or email <> "" Then
Response.Write("Required Information Missing! Please complete source,
name, phone, email, debt amount and city/state or zip.")

End If
End If

%>
</center></font>
</head>
<body>
<table align=center>

<tr><td>
<img border="0" src="cclogo.jpg" width="244" height="59">
</td></tr>

<tr>
<td>
<font size=+2>Welcome to Credit Consultants!</font><p>Please enter the
information requested below:
</td>
</tr>
<tr>
<td>
<form method="get" action="<%=request.servervariables("script_name")%>">
<div>
<tr><td colspan="2" class="text">&nbsp;</td></tr>
<td align=left>
Source:
<input type="text" name="source" maxlength="40" size="20" ID="source">
Lead Type:
<input name="leadtype" maxlength="40" size="20" type="text" ID="leadtype"><p>
Order ID:
<input type="text" name="orderID" maxlength="40" size="15" ID="orderID">
IP Address:
<input type="text" name="ip" maxlength="15" size="15" ID="ip"><p>
First Name:
<input type="text" name="fname" maxlength="40" size="20" ID="fname">
Last Name:
<input type="text" name="lname" maxlength="40" size="20" ID="lname"><br>
Street Address:
<input type="text" name="street" maxlength="40" size="40" ID="street"><br>
City:
<input type="text" name="city" maxlength="40" size="20" ID="city">
State:
<input type="text" name="state" maxlength="40" size="10" ID="state">
Zip Code:
<input type="text" name="zip" maxlength="10" size="10" ID="zip"><p>
Home Phone:
<input type="text" name="hphone" maxlength="40" size="15" ID="hphone">
Work Phone:
<input type="text" name="wphone" maxlength="40" size="15" ID="wphone">
Email:
<input type="text" name="email" maxlength="40" size="25" ID="email"><p>
Debt Amount:
<input type="text" name="debtamt" maxlength="40" size="10" ID="debtamt">
Months Behind:
<input type="text" name="mosbehind" maxlength="3" size="5" ID="mosbehind">
Best Contact Time:
<input type="text" name="contacttime" maxlength="40" size="10"
ID="contacttime"><p>
Comment:
<input type="text" name="comment" maxlength="100" size="80" ID="comment"><p>
Creditor Name:
<input type="text" name="creditor" maxlength="40" size="15" ID="creditor">
Balance:
<input type="float" name="balance" maxlength="40" size="15" ID="balance"><p>
</td></tr>



<tr><td colspan="2" class="text"><input type="submit" name="submit"
ID="Submit1"></td>
</tr>

</div>
</form>
</td>
</tr>
</table>





Sylvain Lafontaine wrote:
First off I do not use MSDN or Action Packs or whatever you are talking
about.
[quoted text clipped - 21 lines]
pirated
software.

You are not asking the question wrong. In my first answer, I gave you
exactly the answer that you have asked for but you don't seem to have
noticed it at all. Just in case that you might have missed it, here it is
again:

http://www.connectionstrings.com/
http://www.carlprothman.net/Default.aspx?tabid=81

On these URLs, you will find all the info required to know how to write a
connection string for SQL-Server. As you are using OLEDB and SQL-Server
2008, using the SQL Native Client OLE DB Provider, version 10; is probably
your best bet. Look on the following page for the provider SQLNCLI10:

http://www.connectionstrings.com/?carrier=sqlserver2008

Before sending the INSERT command, you should also take the precaution of
closing the previous recordset that you have opened for getting the
timezone. Of course, if your insert don't work, the first thing to do would
be to first check if you can read the information from the SQL-Server; ie.,
that the recordset rs has been correctly opened.

As for the good money that you have spent on SQL-Server 2008 with QA,
personnally, I would had have tried the Express edition first. If your
previous installation was a JET (MDB) backend, possibly that the Express
edition of SQL-Server 2008 would have been more than sufficient.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-adp-sqlserver/200810/1

.



Relevant Pages

  • Re: Timestamp in Access-DB bei Netzwerk-Zugriff
    ... > Was passiert (bei ständig offener Connection) wenn die Netzwerkverbindung ... Programm, wie z.B. ein SQL-Server. ... Mehrbenutzerkonflikt entsprechend intelligent zu lösen. ...
    (microsoft.public.de.vb.datenbank)
  • Re: data acces page connect to sql server
    ... the connection even if the parameters are OK; like a firewall for example. ... Using an Alias (see SQL-Server Client Network Utility or something like ... often solve some of these connection problems. ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Dao-Recordset mit datenbank.schema.tabelle
    ... Stelle eine DB von Access auf SQL-Server als BE um ... ... Dim rsZu As DAO.Recordset ... Set rsZu = db.OpenRecordset ... rsVon dagegen über Connection B. ...
    (microsoft.public.de.access.clientserver)
  • Re: Spaltenwerte von SQL- in ACCESS-Tabelle kopieren
    ... > ACCESS2000-Datenbanktabelle kopieren.Eine Connection zum SQL-Server ... Prev by Date: ... Next by Date: ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: SuSE 9.1 finally arrived (long review)...
    ... >> About this timezone, I guess they 'could' see what timezone you are in. ... > are larger than most European countries. ... > European countries that you know of, have 6 time zones, like Canada does? ... The different connection I have made always pointed me to the correct ...
    (alt.os.linux.suse)