Re: creating a database on the server

From: Curt_C [MVP] (software_AT_darkfalz.com)
Date: 05/24/04


Date: Mon, 24 May 2004 12:40:22 -0500

that creates a Table, not a new DB....which is it you are after? Also, why
are you posting it to these groups? some .Net, some not, some SQL.... ??

-- 
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Scott Baxter" <sbaxter@websearchstore.com> wrote in message
news:ukc9HSbQEHA.3300@TK2MSFTNGP09.phx.gbl...
> Is there a way to create a brand new database on the server?
>
> Someone gave me the asp code below, but I haven't gotten it to work yet.
>
> Thanks for any help.
>
> <%
> Dim strSQL
> Dim cnnTest
>
> strSQL = strSQL & "CREATE TABLE tblTest " & vbCrLf
> strSQL = strSQL & "(" & vbCrLf
> strSQL = strSQL & "ID int IDENTITY NOT NULL " & vbCrLf
> strSQL = strSQL & "  constraint PK_tblTestID PRIMARY KEY, " & vbCrLf
> strSQL = strSQL & "FirstName varchar (30) NOT NULL, " & vbCrLf
> strSQL = strSQL & "LastName varchar (30) NOT NULL, " & vbCrLf
> strSQL = strSQL & "DateOfBirth datetime NULL" & vbCrLf
> strSQL = strSQL & ")" & vbCrLf
>
> Set cnnTest = Server.CreateObject("ADODB.Connection")
> response.write "got to here"
> cnnTest.Open "Provider=SQLOLEDB;Data Source=localhost;" _
>      & "Initial Catalog=test;User Id=sa;Password=;" _
>      & "Connect Timeout=15;Network Library=dbmssocn;"
> response.write "are we heare"
> cnnTest.Execute strSQL
> cnnTest.Close
> Set cnnTest = Nothing
> %>
>
>
>


Relevant Pages

  • Re: creating a database on the server
    ... are you posting it to these groups? ... > Someone gave me the asp code below, but I haven't gotten it to work yet. ... > Dim strSQL ... > Set cnnTest = Server.CreateObject ...
    (microsoft.public.sqlserver.connect)
  • Re: creating a database on the server
    ... are you posting it to these groups? ... > Someone gave me the asp code below, but I haven't gotten it to work yet. ... > Dim strSQL ... > Set cnnTest = Server.CreateObject ...
    (microsoft.public.vb.6.webdevelopment)
  • creating a database on the server
    ... Is there a way to create a brand new database on the server? ... Someone gave me the asp code below, but I haven't gotten it to work yet. ... Dim strSQL ... Set cnnTest = Server.CreateObject ...
    (microsoft.public.vb.6.webdevelopment)
  • creating a database on the server
    ... Is there a way to create a brand new database on the server? ... Someone gave me the asp code below, but I haven't gotten it to work yet. ... Dim strSQL ... Set cnnTest = Server.CreateObject ...
    (microsoft.public.dotnet.framework.aspnet)
  • creating a database on the server
    ... Is there a way to create a brand new database on the server? ... Someone gave me the asp code below, but I haven't gotten it to work yet. ... Dim strSQL ... Set cnnTest = Server.CreateObject ...
    (microsoft.public.sqlserver.connect)