Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to view data from table passing through the function?

Posted on 2009-05-06
4
320 Views
Last Modified: 2013-12-25
I am trying to pass the specific table data through the function "StrDecrypt(ST)" and viewed as HTML on the same ASP page.  Is it possible?  I am still misunderstanding how to pass the string from DB to web site going through the Decrypt process. Also, how to view that data via table or datagrid.

Thanks in advance!!!
<%
Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
 
%>
<!--#include virtual=/common.asp-->
<HTML>
<HEAD>
<TITLE>Databook : Personal Phone Book</TITLE>
</HEAD>
<BODY bgcolor=blue>
<%
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "Select * From Phonebook",strConn,1,2
    rs("Name")=StrDecrypt(strName)
    
'''encrypt
Function StrEncrypt(ST)
	Dim EnDecrypt, strToEncrypt, strEncrypted
	Set EnDecrypt = Server.CreateObject("CryptoDLL.FileString")
 
	With EnDecrypt
		.Password = "PASSWORD"
		.Provider = True
		.ConvertHEX = True
		.HashType = 1
		.CipherType = 1
		StrEncrypt = .EncryptString(ST)
	End With
	Set EnDecrypt = Nothing
End Function
 
'''decrypt
Function StrDecrypt(ST)
	Dim EnDecrypt, strToEncrypt, strEncrypted
	Set EnDecrypt = Server.CreateObject("CryptoDLL.FileString")
 
	With EnDecrypt
		.Password =  "PASSWORD"
		.Provider = True
		.ConvertHEX = True
		.HashType = 1
		.CipherType = 1
 
		StrDecrypt = .DecryptString(ST)
	End With
	Set EnDecrypt = Nothing
End Function
 
%>
 
</BODY>
</HTML>

Open in new window

0
Comment
Question by:tendimes
4 Comments
 
LVL 15

Accepted Solution

by:
dosth earned 500 total points
ID: 24323570
try this
<%
Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
 
%>
<!--#include virtual=/common.asp-->
<HTML>
<HEAD>
<TITLE>Databook : Personal Phone Book</TITLE>
</HEAD>
<BODY bgcolor=blue>
<%
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "Select * From Phonebook",strConn,1,2
    
	strDbName = rs("Name")
	Response.Write("Original Name" & strEncryptName)
	
	strEncryptName =  StrEncrypt(strDbName)	
	Response.Write("<br>Encrypted Name" & strEncryptName)
	
    strDecryptName= StrDecrypt(strEncryptName)
	Response.Write("<br>Decrypted Name" & strDecryptName)
 
    
'''encrypt
Function StrEncrypt(ST)
        Dim EnDecrypt, strToEncrypt, strEncrypted
        Set EnDecrypt = Server.CreateObject("CryptoDLL.FileString")
 
        With EnDecrypt
                .Password = "PASSWORD"
                .Provider = True
                .ConvertHEX = True
                .HashType = 1
                .CipherType = 1
                StrEncrypt = .EncryptString(ST)
        End With
        Set EnDecrypt = Nothing
End Function
 
'''decrypt
Function StrDecrypt(ST)
        Dim EnDecrypt, strToEncrypt, strEncrypted
        Set EnDecrypt = Server.CreateObject("CryptoDLL.FileString")
 
        With EnDecrypt
                .Password =  "PASSWORD"
                .Provider = True
                .ConvertHEX = True
                .HashType = 1
                .CipherType = 1
 
                StrDecrypt = .DecryptString(ST)
        End With
        Set EnDecrypt = Nothing
End Function
 
%>
 
</BODY>
</HTML>

Open in new window

0
 
LVL 25

Expert Comment

by:kevp75
ID: 24327184
i was gonna say, you aren't writing anything to the page...  all you are doing is including some functions and calling a recordset...


why don't you explain exactly what it is you are trying to do...  just display a name?  what do you mean by "table"?
0
 

Author Comment

by:tendimes
ID: 24329240
Dosth: Code works perfect.  Thank you!  Now I am having an issue with the RecordSet timing out because it has 100,000+ records.  I increased the server timeout length and also defined the SQL statement to a smaller amount of records.  Although this way of doing things will take many days.  Is there any other options?

Kevp75: The goal was to export my encrypted phonebook data as clear text using the above function.  Now that I am able to export the data I am looking for a method to export all 100,000 records in a timely manner.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question