Showing posts with label record. Show all posts
Showing posts with label record. Show all posts

Sunday, March 25, 2012

connecting to sql from ASP

I created a webpage where someone can enter in new client
info. Using asp, I want to connect to the sql db and add
the new record. I'm using SQL2k in an W2K environment. I
want to use the trusted connection so SQL would use the
windows login to authenticate. Below is the code for
connecting to the sql server:
<%
dim cn, cs
Set Cn = Server.CreateObject("ADODB.Connection")
Cn.open "PROVIDER=SQLOLEDB;DATA
SOURCE=webbus\lab;TRUSTED_CONNECTION=YES;DATABASE= Client"
Set cs = Server.CreateObject("ADODB.Recordset")
cs.Open "SELECT * FROM CallerTest"
%>
When I click the Save button on the webpage to add the new
info, I get this error:
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'WEBBUS\IUSR_WEBBUS'.
/lab/addnew.asp, line 95
Line 95 is the cn.Open line
What am I missing?
Ngan,
trusted security means that it'll use the IUSR_IISCOMPUTERNAME user for
anonymous access by default. This is configurable to another domain user in
IIS on the security tab for your website. If you want to use windows logins,
then you must disable anonymous and have windows integrated impersonation.
HTH,
Paul Ibison
|||How do I go about disabling the anonymous and having the
windows integrated impersonation?
Thanks!

>--Original Message--
>Ngan,
>trusted security means that it'll use the
IUSR_IISCOMPUTERNAME user for
>anonymous access by default. This is configurable to
another domain user in
>IIS on the security tab for your website. If you want to
use windows logins,
>then you must disable anonymous and have windows
integrated impersonation.
>HTH,
>Paul Ibison
>
>.
>
|||Programs, Administrative Tools, IIS. Select the website then right-click
proerties, directory security, edit. Untick enable anonymous access and tick
Integrated Windows Authentication. It's worth reading up on the options here
as if this is an internet site (rather than intranet or extranet) then
you'll need Basic Authentication, preferably with SSL.
HTH,
Paul Ibison
|||Thanks for that info! This will be an intranet website so
I'll just do the integrated windows thingie.
Currently, I have people from our provider companies
connected to me via a T1, so they don't have a windows
login. They are accessing the website anonymously, I
assume. If I turn off the anonymous access, I take it
they won't be able to view the website anymore.
How do I go about giving them "guest" access? Do I give
each company their own user account or group them somehow
into one guest group?
Thanks.
Ngan

>--Original Message--
>Programs, Administrative Tools, IIS. Select the website
then right-click
>proerties, directory security, edit. Untick enable
anonymous access and tick
>Integrated Windows Authentication. It's worth reading up
on the options here
>as if this is an internet site (rather than intranet or
extranet) then
>you'll need Basic Authentication, preferably with SSL.
>HTH,
>Paul Ibison
>
>.
>
|||They can access the site, but the windows login dialog box will come up.
Regards,
Paul Ibison
|||Sorry,
misread your previous post - yes, the previously anonymous users will be
prompted with a windows login dialog box. You'll need to give them a login
they can use. If all people use this login then you might as well go back to
anonymous, but if this is yust a subset of people then creating separate
windows logins makes sense. Alternatively you could use forms logins for
either ASP or ASP.NET.
Regards,
Paul Ibison
sqlsql

connecting to sql from ASP

I created a webpage where someone can enter in new client
info. Using asp, I want to connect to the sql db and add
the new record. I'm using SQL2k in an W2K environment. I
want to use the trusted connection so SQL would use the
windows login to authenticate. Below is the code for
connecting to the sql server:
<%
dim cn, cs
Set Cn = Server.CreateObject("ADODB.Connection")
Cn.open "PROVIDER=SQLOLEDB;DATA
SOURCE=webbus\lab;TRUSTED_CONNECTION=YES
;DATABASE=Client"
Set cs = Server.CreateObject("ADODB.Recordset")
cs.Open "SELECT * FROM CallerTest"
%>
When I click the Save button on the webpage to add the new
info, I get this error:
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'WEBBUS\IUSR_WEBBUS'.
/lab/addnew.asp, line 95
Line 95 is the cn.Open line
What am I missing?Ngan,
trusted security means that it'll use the IUSR_IISCOMPUTERNAME user for
anonymous access by default. This is configurable to another domain user in
IIS on the security tab for your website. If you want to use windows logins,
then you must disable anonymous and have windows integrated impersonation.
HTH,
Paul Ibison|||How do I go about disabling the anonymous and having the
windows integrated impersonation?
Thanks!

>--Original Message--
>Ngan,
>trusted security means that it'll use the
IUSR_IISCOMPUTERNAME user for
>anonymous access by default. This is configurable to
another domain user in
>IIS on the security tab for your website. If you want to
use windows logins,
>then you must disable anonymous and have windows
integrated impersonation.
>HTH,
>Paul Ibison
>
>.
>|||Programs, Administrative Tools, IIS. Select the website then right-click
proerties, directory security, edit. Untick enable anonymous access and tick
Integrated Windows Authentication. It's worth reading up on the options here
as if this is an internet site (rather than intranet or extranet) then
you'll need Basic Authentication, preferably with SSL.
HTH,
Paul Ibison|||Thanks for that info! This will be an intranet website so
I'll just do the integrated windows thingie.
Currently, I have people from our provider companies
connected to me via a T1, so they don't have a windows
login. They are accessing the website anonymously, I
assume. If I turn off the anonymous access, I take it
they won't be able to view the website anymore.
How do I go about giving them "guest" access? Do I give
each company their own user account or group them somehow
into one guest group?
Thanks.
Ngan

>--Original Message--
>Programs, Administrative Tools, IIS. Select the website
then right-click
>proerties, directory security, edit. Untick enable
anonymous access and tick
>Integrated Windows Authentication. It's worth reading up
on the options here
>as if this is an internet site (rather than intranet or
extranet) then
>you'll need Basic Authentication, preferably with SSL.
>HTH,
>Paul Ibison
>
>.
>|||They can access the site, but the windows login dialog box will come up.
Regards,
Paul Ibison

Tuesday, March 20, 2012

Connecting to Paradox

Hello,
I am trying to connect to paradox database for the purpose of updating
the record(s) in DTS ActiveX Script Task.
I used the following connection string. But I get an error while
connection. I have "UMTest.db" and "UMTest.px" files in the
"C:\MYDBPath" in my local drive.
Set objRs =3D CreateObject("ADODB.RecordSet"=AD)
DB_STRING =3D "Provider=3DMicrosoft.Jet.OLEDB.=AD4.0;Data
Source=3DC:\MYDBPath;Extended Properties=3DParadox 5.x;"
strSQL =3D " UPDATE UMTest SET Field1 =3D 1.222 WHERE Col1ID =3D '" & Value1
& "' AND Col2 =3D '" & Value2 & "'"
objRs.Open strSQL, DB_STRING
I get the following error.
Error Source: Microsoft Jet Database engine.
Error Description: No Value given for one or more required parameters.
Connection string looks alright to me. I don't know what is other
reason which is causing this error to happen.=20
Thanks.
You may try to create a User DSN first using ODBC Administrator. Instead of
DB_STRING="..", you can set DB_STRING=UserDSNNameYouCreated. To simplify it,
please do not include update command. Try to connect it first and see if it
works.
Thanks
Bei
"Yunus's Group" <yunusasmath@.gmail.com> wrote in message
news:1123266364.868066.278640@.g43g2000cwa.googlegr oups.com...
Hello,
I am trying to connect to paradox database for the purpose of updating
the record(s) in DTS ActiveX Script Task.
I used the following connection string. But I get an error while
connection. I have "UMTest.db" and "UMTest.px" files in the
"C:\MYDBPath" in my local drive.
Set objRs = CreateObject("ADODB.RecordSet"X)
DB_STRING = "Provider=Microsoft.Jet.OLEDB.X4.0;Data
Source=C:\MYDBPath;Extended Properties=Paradox 5.x;"
strSQL = " UPDATE UMTest SET Field1 = 1.222 WHERE Col1ID = '" & Value1
& "' AND Col2 = '" & Value2 & "'"
objRs.Open strSQL, DB_STRING
I get the following error.
Error Source: Microsoft Jet Database engine.
Error Description: No Value given for one or more required parameters.
Connection string looks alright to me. I don't know what is other
reason which is causing this error to happen.
Thanks.

Connecting to Paradox

Hello,
I am trying to connect to paradox database for the purpose of updating
the record(s) in DTS ActiveX Script Task.
I used the following connection string. But I get an error while
connection. I have "UMTest.db" and "UMTest.px" files in the
"C:\MYDBPath" in my local drive.
Set objRs =3D CreateObject("ADODB.RecordSet"=AD)
DB_STRING =3D "Provider=3DMicrosoft.Jet.OLEDB.=AD4.0;Data
Source=3DC:\MYDBPath;Extended Properties=3DParadox 5.x;"
strSQL =3D " UPDATE UMTest SET Field1 =3D 1.222 WHERE Col1ID =3D '" & Value1
& "' AND Col2 =3D '" & Value2 & "'"
objRs.Open strSQL, DB_STRING
I get the following error.
Error Source: Microsoft Jet Database engine.
Error Description: No Value given for one or more required parameters.
Connection string looks alright to me. I don't know what is other
reason which is causing this error to happen.=20
Thanks.You may try to create a User DSN first using ODBC Administrator. Instead of
DB_STRING="..", you can set DB_STRING=UserDSNNameYouCreated. To simplify it,
please do not include update command. Try to connect it first and see if it
works.
Thanks
Bei
"Yunus's Group" <yunusasmath@.gmail.com> wrote in message
news:1123266364.868066.278640@.g43g2000cwa.googlegroups.com...
Hello,
I am trying to connect to paradox database for the purpose of updating
the record(s) in DTS ActiveX Script Task.
I used the following connection string. But I get an error while
connection. I have "UMTest.db" and "UMTest.px" files in the
"C:\MYDBPath" in my local drive.
Set objRs = CreateObject("ADODB.RecordSet"_)
DB_STRING = "Provider=Microsoft.Jet.OLEDB._4.0;Data
Source=C:\MYDBPath;Extended Properties=Paradox 5.x;"
strSQL = " UPDATE UMTest SET Field1 = 1.222 WHERE Col1ID = '" & Value1
& "' AND Col2 = '" & Value2 & "'"
objRs.Open strSQL, DB_STRING
I get the following error.
Error Source: Microsoft Jet Database engine.
Error Description: No Value given for one or more required parameters.
Connection string looks alright to me. I don't know what is other
reason which is causing this error to happen.
Thanks.