Create | data | Database on the Internet to see a lot of this code, but some are not available, some are too many garbage code, I simply modified a bit now share with you.
Option Explicit
Dim DatabaseName ' defines the database name
Databasename= "Database.mdb" database name
Dim DatabasePath ' Defines the database store path
Databasepath= "D:\office\jd\21\database\" Database absolute path
Dim databasever ' defines database version 2000 or 97
Databasever = "2000"
Function Createdfile (Filepath,
Createdfile (Filepath,filename,ver)
Dim Cnbruce,dbver
Select Case ver
Case "97"
Dbver = "3.51"
Case "2000"
Dbver = "4.0"
End Select
If Dbver Set cnbruce = Server.CreateObject ("ADOX. Catalog ")
Call Cnbruce. Create ("Provider=microsoft.jet.oledb." Dbver ";D ata source=" filepath filename)
End If
End Function
Call Createdfile (databasepath,databasename,databasever) ' Create a database
%>
So, let's look at how to design a new database tabl
) = "/" Then Dbfilename = Trim (Mid dbfilename,2,len (dbfilename))
If dbexists (Savepath Dbfilename) Then
Response.Write ("Sorry, the database already exists!")
Createdbfile = False
Else
Dim Ca
Set Ca = Server.CreateObject ("ADOX.") Catalog ")
If err.numberResponse.Write ("cannot be established, please check the error message Err.Clear
Exit function
End If
If dbver=0 Then
Call Ca.create ("Provider=microsoft.jet.oledb.3.51;data source=" Savepath Dbf
; Data consumers, which use data; and service components, which process and transport data (such as query processors and cursor). In addition, OLE DB includes a bridge to ODBC to enable continued support for the broad range of ODBC relational database Drivers.
Open Database Connectivity (ODBC)
The Microsoft Open Database connectivity (ODBC) interface makes it possible for applications to access data from a variety of DBMSs. ODBC permits maximum Interoperability-an application can access data in
access| Data | Database Call Renametable ("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=c:\example.mdb "," Test "," changed ")
Sub renametable (Constr, Oldname, NewName)
' has to be OLE DB connection
' Create object and connect to DB ...
Dim Objadoxdatabase
Set objadoxdatabase = Server.CreateObject ("ADOX. Catalog ")
Objadoxdatabase.activeconnection = Constr
' Change the name ...
Objadoxdatabase.tables (oldname). Name = NewName
' Clean up ...
S
access| Data | Database Call Renametable ("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=c:\example.mdb "," Test "," changed ")
Sub renametable (Constr, Oldname, NewName)
' has to be OLE DB connection
' Create object and connect to DB ...
Dim Objadoxdatabase
Set objadoxdatabase = Server.CreateObject ("ADOX. Catalog ")
Objadoxdatabase.activeconnection = Constr
' Change the name ...
Objadoxdatabase.tables (oldname). Name = NewName
' Clean up ...
Se
Tags: os SP file data log BS code AD amp' Create Database' Parameter: Strdbpath full path to the string database fileSub CreateDatabase (Strdbpath)Dim CatobjSet catobj = CreateObject("ADOX. Catalog ")Catobj.create "Provider=Microsoft.Jet.OLEDB.4.0;" "Data Source =" StrdbpathSet catobj = NothingEnd Sub ' About catobj.create parameter description, this string, where provider represents the database version, Baidu search out the code is mostly microso
,len (dbfilename))
If dbexists (Savepath Dbfilename) Then
Response.Write ("Sorry, the database already exists!")
Createdbfile = False
Else
Dim Ca
Set Ca = Server.CreateObject ("ADOX.") Catalog ")
If err.numberResponse.Write ("cannot be established, please check the error message Err.Clear
Exit function
End If
If dbver=0 Then
Call Ca.create ("Provider=microsoft.jet.oledb.3.51;data source=" Savepath Dbfilename)
Else
Call Ca.create ("Provider=Microsof
This is to escape LAKER2 brother check ASP Trojan horse program
Now that the challenge has been successful, it has been added to the test object. Published code to the freezing point of friends make, I hope you like!
The Adox.catalog component is used
Copy Code code as follows:
' Code by Netpatch
Dim dbfile,sql
db= "Netpatch.asp"
Dbfile=server. MapPath (DB)
Set Ydb=server. CreateObject ("ADOX.") Catalog ")
Ydb. Create "Provider=Mi
or AddNew () and update () with SQL statements
>>> Rs. AddNew ()
>>> Rs. Fields.item (1). Value = ' data '
>>> Rs. Update ()
These values can also be returned:
>>> x = Rs. Fields.item (1). Value
>>> Print X
' Data '
So if you want to add a new record, you don't have to look at the database to know what number and AutoNumber fields have been generated
>>> Rs. AddNew ()
>>> x = Rs. Fields.item (' Auto_number_field_name '). Value
# x contains the AutoNumber
>>> Rs. Fields.item (' Field_name '). V
("Sorry, the database already exists!")
Createdbfile = False
Else
Dim Ca
Set Ca = Server.CreateObject ("ADOX.") Catalog ")
If err.numberResponse.Write ("cannot be established, please check the error message")
" Err.Number "
" Err.Description)
Err.Clear
Exit function
End If
If dbver=0 Then
Call Ca.create ("Provider=microsoft.jet.oledb.3.51;data source=" Savepath Dbfilename)
Else
Call Ca.create ("Provider=Microsoft.Jet.OLEDB.4.0;Data source=" Savepa
Stored Procedures | data | database | display
It's no easy trick to the stored procedures in a database programmatically with a scripting-like ASP. If you are using MS Access, you are ' re out of luck. Access provides no way to the actual meat of a stored procedure although you can get the names of the procedures in th e database with the ADOX. Catalog COM object.
But, if you are are using SQL Server (like you should is because you care about your da
Displaying stored procedures in a database __ rpmIt's no easy trick-see stored procedures in a database programmatically with a scripting language like ASP. If you're using MS Access, you're out of luck. Access provides no-the-actual meat of a stored procedure although you can get the names of the procedures in th e database with the ADOX. Catalog COM object.But, if you were using SQL Server (like you should is because you care about your data), you h
; "Rs. Open "SELECT * from professional where professional name Do and not Rs. EofDebug.Print Rs. Fields ("Professional name")Rs. MoveNextLoopthree. Get the names of all the tables in the databaseUse ADO to get all the table names, not as direct as DAO, so many people do not know how to do. I was also one day idle bored, a mess to do a half-day test, accidental discovery of this stuff.First, add two references: Microsoft ActiveX Data Objects 2.5 Library and Microsoft ADO Ext. 2.5 for DDL and Sec
Http://www.360doc.com/content/11/0118/20/991597_87447868.shtmlHttp://tec.liugens.com/html/sql/20071227/38157.htmlHttp://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_20510684.htmlAnswerBy:hinnackPosted on 2003-02-12 at 07:58:51id:7934487HiThe only working-I know is using dao!DBEngine = Createoleobject ("DAO. dbengine.36 ");db = DBEngine. OpenDatabase (' Db\extract.mdb ');Db. TableDefs (TBL). Fields (CLO). AllowZeroLength = True;Db. Close;So use this for late-binding or import th
later adopted by X/open and ISO/IEC, as part of the SQL standard, which can be seen in the relevant standard documents such as ISO/IEC 9075-3:1995 (E) call-level Interface (SQL/CLI).JDBC:JDBC (Java Data Base Connectivity,java Databaseconnection) is a Java API for executing SQL statements that provides unified access to a variety of relational databases,Java languagecomposed of classes and interfaces written. JDBC provides a benchmark on which to build more advanced tools and interfaces that ena
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.