Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 24th, 2004, 01:10 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default password in encrypted form

I am using visual studio 6.0 (interdeav)

How can save password in the sql server 2000 in Encrypted form ?
So that no body (administrator also) can not see the password.
administrator can change or delete the password but not see.
It is possible in sql server 2000 ?

There is any method that save password in secure way in sql server 2000 ?

In sql server pw field data type is varchar

Asp code is

<TR>
    <TD>Contract No.</TD>
    <TD><INPUT type=password id=pw name=pw></TD></TR>
  <TR>



Second problem in Date format

When I save date format like this

Day-month-year it give following error

Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E07)
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
/dcilweb/sas/add_cont.asp, line 48

If I save date in year-month-day format it save the date, not error,

How can I change date formt day-month-year ?


Mateen



 
Old January 24th, 2004, 02:23 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I just implemented this on a user login table in SQL...

You would typically, encrypt the password before storing into the table. Depending on your programming environment, you can search for a number of encryption routines. My personal preference is AES but the source code might be difficult to find for other than C++.

There is also the RC4 algorithm which can be readily found but far less secure.

As for the date problem, you might try to validate the date field entry before storing into the database field...


 
Old January 24th, 2004, 06:20 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for your response.
some one inform me about the encryption routines address is

http://aspnet.4guysfromrolla.com/articles/103002-1.aspx
(it deals with ASP.net, I will get the idea).
Javascript version of MD5 http://pajhome.org.uk/crypt/md5/

how I can validate the date field ?
you may give me syntax ?

My another problem is that
when I save the entry (contract.asp) it save double values
in the table, I check my query in sql analyzer, there
is no problem, by the sql analyzer it save single record.

why it save double records by the asp file (contract.asp)
in sql server table ?

Please check the code is following.


isql1="insert into emp (empno,fname,mname,lname,posit,dept,strdate,emptyp e) values ("
isql2="'" & empno & "',"
isql3="'" & fname & "',"
isql4="'" & mname & "',"
isql5="'" & lname & "',"
isql6="'" & posit & "',"
isql7="'" & dept & "',"

if IsDate(strdate) then
isql8="'" & strdate & "',"
else
isql8="NULL,"
end if

isql9="'" & emptype & "')"


sql=isql1+isql2+isql3+isql4+isql5+isql6+isql7+isql 8+isql9

cn.Execute sql

cn.Execute sql
if err.number=0 then
Response.Redirect("add_emp2.asp")
else
Response.Redirect("add_emp3.asp")
end if



regards.

Mateen



Quote:
quote:Originally posted by U.N.C.L.E.
 I just implemented this on a user login table in SQL...

You would typically, encrypt the password before storing into the table. Depending on your programming environment, you can search for a number of encryption routines. My personal preference is AES but the source code might be difficult to find for other than C++.

There is also the RC4 algorithm which can be readily found but far less secure.

As for the date problem, you might try to validate the date field entry before storing into the database field...


 
Old January 24th, 2004, 06:25 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I think you're overlooking the obvious. You may either need some coffee, or some sleep ;)
Code:
sql=isql1+isql2+isql3+isql4+isql5+isql6+isql7+isql8+isql9

cn.Execute sql

cn.Execute sql
The SQL statement gets executed twice, so you get two records.....

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old January 24th, 2004, 07:52 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks.

date format problem is there,
how can validate the date dd/mm/yyyy in ASP ?
how can save date dd/mm/yyyy format by the ASP ?
any asp code ?



yes I need some coffee.

Mateen


Quote:
quote:Originally posted by Imar
 I think you're overlooking the obvious. You may either need some coffee, or some sleep ;)
Code:
sql=isql1+isql2+isql3+isql4+isql5+isql6+isql7+isql8+isql9
Code:
cn.Execute sql

cn.Execute sql
The SQL statement gets executed twice, so you get two records.....

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Encrypted Password cancer10 Classic ASP Databases 0 April 10th, 2007 11:12 PM
Encrypted password harini19 Java Basics 0 February 15th, 2006 07:29 AM
Random+Encrypted Password ruhin Pro PHP 1 June 28th, 2004 02:07 PM
Encrypted Password field knight Classic ASP Databases 7 June 28th, 2004 12:35 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.