I used to talk about a lot of issues related to opening the database connection security. Now I will put forward a kind of ideas.
Use ActiveX DLL to protect your code. (You can don't need to worry about using shared encryption software,
More importantly, I can have my own way to dig, enjoy the feeling of "everything in master".
At the same time, in order to let everyone do their own components. )
ActiveX DLLS is a compiled machine code, and if there is no source project file, it is unable to be compiled.
This technology enables developers to develop public automation procedures and release them as a ShareWare version of the program.
This item can be seen in some components sold in ChinaASP.
If you want to protect some of the code in your ASP, for example, you don't want others to see what you are using.
Database, or don't want others to see how important functions are completed, or an important
Process (Cakk can be found), you can make your own components through constant development, this is a DLL file, that is, someone got it.
This DLL file, it will not be able to get important information you want to protect at all. And these components you have developed
Give your program brings a new source of origin.
Let's take a very commonly used, everyone cares about how to keep the process of opening the database.
The example is simple, it is to display the contents of a field in a database in a drop-down box.
The whole process is as follows:
1. Newly built a VB6 ActiveX DLL project
2. In the Properties window, name your library module and project file. In the example, the Keiths_lookup project name and the Lookup module name.
This written name is the DLL function name you will be referenced in the ASP (the object name in the ASP will be keiths_lookup.lookup).
3. Use the same name store (of course, the suffix is not the same).
4. Select References from the project menu in VB6. Then select Microsoft ActiveX Data Objects 2.0 Library, Microsoft
ActiveX Data Objects Recordset 2.0 Library.
The code of the file is as follows:
Public Function HTML_COMBO (Comboname As String, Lookup_field As String) AS STRING
Dim outstring as string
DIM Conn as adodb.connection
DIM RST As Adodb.Recordset
DIM SQLSTRING AS STRING
SET CONN = CreateObject ("AdoDb.Connection")
Set Rst = CreateObject ("AdoDb.Recordset")
'The field name in these databases is just set for this example, you can modify the code according to your needs.
Sqlstring = "SELECT [Lookup_Description], [Lookup_Key] from _
[Lookup_table] where [look_field] = '"& lookup_field &"' "
'You can enter the username and password you connect to the database, and now you can see the ASP source code.
'He can't know what password you are using, huh, huh.
Conn.open "DSN = SUMNET; UID =; PWD = .;"
Rst.open Sqlstring, CONN, 3, 3
IF not rst.eof deathrst.movefirst
Outstring = "
Rst.fields ("Lookup_Description") & " option>"
Rst.movenext
Loop
END IF
Outstring = outstring & " select>"
HTML_COMBO = OUTSTRING
Rst.Close
Conn.close
END FUNCTION
At the end of the code, huh, huh, basically there is no technical difficulty, now save your project and start compiling.
1. Open the Package Deployment Wizard program with Visual Studio 6.
2. Select the ActiveX project file you just created.
3. Choose package
4. Select the script you want to pack or use the default script
5. Select standard installation
6. Select a directory where you place your installation file
7. Select Single Cab.
8. Other default, then click Next
9. Now after the installer is complete, get it getting it on your IIS server.
Let's give the code for this component you do it yourself:
<% @ Language = "VBScript"%>
<%
SET LOOK = Server.createObject ("Keiths_lookup.lookup")
%>
<% = Look.html_COMBO ("State", "States")%>
<% = Look.html_COMBO ("Position", "Positions")%>
<% = Look.html_COMBO ("age_group", "age_groups")%>
Body>
Html>
You see, the ASP is so simple, who saw the source file, you don't have to worry, you can see,
Using ActiveX DLL technology can protect your important code very well, you need a safe part,
But I don't want everyone to hold my code in the future, I don't want to be open, after all,
The domestic software industry is still far behind, and everyone needs to work together to progress together.