Here's what I want to do: I have an application that delivers web based security forms for individuals to fill out. I am trying to write a GUI that will allow someone with little coding experience create a form. I want to offer the option of copying an existing form (including the actual ASP page and SQL table). I can handle duplicating and renaming the actual ASP form, but I can find no information on how to copy a tables columns, data types, constraints and triggers from an existing table to a new one, renaming the new table to correlate to the new form. I hope someone can help me. Thanks!
Robby
Posts
-
Duplicate a SQL Server table -
include html in htmlIf using 'include virtual' it doesn't matter if the file is in the same directory or not - you always specify the absolute path from the web root. Meaning, if your domain name is acme.com, and you have a folder called 'includes', then the full URL to your includes would be www.acme.com/includes/...same with this. If your a.html is in a directory other than the web root, then you have to specify it (i.e., include virtual = "/includes/a.html" or whatever your path is). If it's in the same directory you can simply use 'include file' and it will work in your particular example as well. Robby
-
include html in html(i.e. if I have an includes folder at the root of my web dir) or (i.e. to 'step back' one dir and into the includes folder.) include virtual is the best way to include a file.
-
Trying to execute a simple command...I am attempting to create a variable for every field in a record set. When attempting to run this code, I get simply a "Syntax Error". Does anyone know why this won't work? Set RS = Server.CreateObject("ADODB.Recordset") RS.Open "SELECT * FROM " & tableName, MyConn For each Field in RS.Fields createVar = Field.Name & "=" & Field.Value Execute(createVar) Next Thanks
-
No one seems to know how...Thanks, the problem is that I do not want to define anything because I have so many tables with so many different column values. Basically I just want a 2d array that will have the column name and the value for that column. I am only selecting one row on my select statement, so i want array something like: lastName,doe firstName,john column3,True column4,True column5,True column6,True etc... Anyone? Thanks, Robby
-
No one seems to know how...I'm trying to do something that is even stumping the web services guys at the company I work. I know it's simple, just can't figure out the syntax! It's also very difficult to explain, so here goes: I am wanting to SELECT * from a table, and then iterate through each record in the RS, defining each record as a variable with only a few lines of code. For instance, instead of this: lastName = RS("lastName") I want to do something like this (I know this syntax is erroneous, only way to explain): For each Field in RS [Field.Name.in.RS] = [Field.Value.in.RS] Next So, theoretically, when the cursor reaches 'lastName' in the RS, it will create a variable called lastName and assign the value of lastName to it. Make sense? I simply want to select and create variables for ALL results from a query without having to manually state them. I know someone will want to know why the heck I want to define all these when I can just plug them in HTML as RS("lastName"), but trust me, I need this! Thanks, Robby:confused:
-
Windows 2000 HardwareI am looking into the possibilities of creating an IN-HOUSE solution for restoring an image of 2000 O/S to any server regardless of hardware. The only way I know this will work is if I can somehow detect the current hardware and enter those settings in the registry. Does anyone know of a way (or is there an existing command line util) that will run the hardware detect? I would like to restore a Win2K image and then run hardware detect (similar to what Windows does during setup). Any thoughts?
-
LDAP VBScript & ASPI have searched and searched and can't find specific answers to these questions on LDAP. If you respond to this thread, please be detailed, and thanks very much for your help! I have a ActiveX LDAP component that I am using from within an ASP page to authenticate users (by doing a bind a search). I have a two part question: a) is it necessary to have a component to perform this? Is there no VBScript or other way of authenticating and passing the results to an ASP page? b) what is necessary to perform this securely. Other than pointing to port 636, I know that I have to have SSL cert installed on my IIS, but is that it? I have SSL and I point to 636 (assuming 636 is listening). Any help is greatly appreciated, I just can't seem to find much on this PARTICULAR situation. I have no experience with PHP, but if there is a way to do it and pass the LDAP response to ASP, that's fine with me too!
-
Array QuestionI have little experience with arrays and would like some help. I am querying an LDAP directory via a ActiveX component called AdvLDAP from Aspfusion.net. The code is below. What I want to do is be able to perform IF THEN statements on the variables in the array and insert some into a table. You can see from the LDAP.Attributes line what attributes I am returning. For instance, I want to return the attribute and value of "User-Suspend" so that I can perform something like "IF User-Suspend = "Y" THEN"...any help is appreciated. =========================================== dim LDAP set LDAP = Server.CreateObject("AdvLDAP.LDAP") LDAP.ServerName = "10.1.58.25" LDAp.Port = "389" LDAP.UserName = "tssacid=dsldap" LDAP.Password = "*******" LDAP.DN "c","us" LDAP.DN "o","upb" LDAP.DN "host","CAICCI" LDAP.DN "tssadmingrp","Acids" LDAP.DN "tssacid",""&userID&"" LDAP.Attributes = "Name;user-type;user-suspend" LDAP.Filter = "objectclass=*" LDAP.Scope = "Base" Set Result = LDAP.Query() if (LDAP.IsError = 1) then Response.Write LDAP.ErrorReason & "
" else %> <% Dim cols,rows,Arr() cols = 0 rows = 0 for each Member in Result%> <%cols = cols+1 if (cols = 1) then set Links = Member.ValuesList() for each item in Links rows = rows + 1 next set Links = Nothing end if next %> <% ReDim Arr(cols, rows) c1 = 0 for each Member in Result r1 = 0 set Lnks = Member.ValuesList() for each Item in Lnks val = "" itm = Item.Value for i = 0 to ubound (itm) val = val & itm(i) if (i <> ubound (itm))then val = val & ", " end if next Arr(c1,r1) = val r1 = r1 + 1 next set Lnks = Nothing c1 = c1+1 next for rw = 0 to rows-1%> <%for cl = 0 to cols-1%> <%next%> <%next%><%=Member.Attributes%>
<% if (Arr(cl,rw) <> "")then Response.Write Arr(cl,rw) else Response.Write "-" end if%>
<% End If %>
-
Unique SolutionJason, actually we have been successful in transfering an image via a web browser from a camera with minimal trouble for the end-user. It appears from your response that you totally misunderstood my question.
-
Automate registering a DSNI have been researching for ways to automatically create a SQL Server DSN on a local machine for a application and include it in the installation of the client to eliminate a user attempting to set the DSN themselves. I have found a couple of examples inserting information into the registry, but I do not want to do it this way. I found a vague article on the use of DBEngine.RegisterDatabase function, but am unable to find details. Has anyone performed this in the past? :~
-
Automatic Import?I need to take a delimited file and import it into a SQL table. The table is already setup and I have MANUALLY imported the file to populate it and get it going. This file will be updated EVERY night and I want to keep the table updated. How do I automate this? What is the SQL code? Should I drop the table and re-create it nightly?
-
Registering a SQL ServerThis is my first run with SQL Server 2000. I have the server setup on my network, but when I go to "Register New Server" within Enterprise Agent, it's not listed. It's listed in the Win2k ODBC Admin tools (where you setup DSN's), but not within Enterprise Agent. There is a server showing up, but it is not mine. There are about 30 or so SQL server's out there (which, again, are listed where you setup ODBC in Win2K), but only one of these are showing up with I go to register a new server. What are some of the possible problems? I have verified protocol setup of TCP/IP for both server and client. Any help is appreciated!
-
Registering new SQL ServerThis is my first run with SQL Server 2000. I have the server setup on my network, but when I go to "Register New Server" within Enterprise Agent, it's not listed. It's listed in the Win2k ODBC Admin tools (where you setup DSN's), but not within Enterprise Agent. There is a server showing up, but it is not mine. There are about 30 or so SQL server's out there (which, again, are listed where you setup ODBC in Win2K), but only one of these are showing up with I go to register a new server. What are some of the possible problems? I have verified protocol setup of TCP/IP for both server and client. Any help is appreciated!
-
Display Row Numberyou can also do this by changing your identity to "NO" in the design view, saving the table and then re-instating the identity to YES
-
Can I SELECT information the same time i INSERTI want to know if there is a way to get the PK from a row the minute I insert information. Here's the scenario, what's the most efficient way of doing this? 1. I have 50 tables that represent 50 HTML forms. 2. I am inserting results from OnlineAccess.asp into dbo.OnlineAccess. 3. I am keeping all dateTime stamps along with the status of the request (OPEN, BEING PROCESSED, COMPLETE) in another table called dateTime. 4. I want to get the PK of the information entered into dbo.OnlineAccess so that I can insert this into dbo.DateTime for relation to dbo.OnlineAccess's information. Is there any "bi-di" capabilities that can be used to return the PK without having to run another line of code to SELECT the PK WHERE . For instance, I know I can do it this way, but it seems like too much leg work: sqlInsert = "INSERT into OnlineAccess(userID,lastName,firstName,...) values('"&userID&"','"&lastName&"','"&firstName&"',...)" sqlSelect = "SELECT requestID FROM OnlineAccess WHERE userID='"&userID&"' AND lastName='"&lastName&"' AND ..." RS = MyConn.Execute(sqlSelect) requestID = RS("requestID") sqlInsert = "INSERT into DateTime (requestID,status) values('"&requestID&"','OPEN')" (I have a trigger that takes care of the dateTime stamps based on the status) Can anyone help me on this one? Thanks in advance! Robby
-
Here's an easy one for youI have about 30 pages that are identical except for minor things. Here's the scenarion: A person selects multiple recipients for a message, let's say they pick COLLECT1 and COLLECT2. I want to send a different message to COLLECT1 than COLLECT2 and include the information that the "user" has provided. The code for the two pages for gaining the email address and sending the email is indentical. There are no errors when the user submitts the request, but the email only reaches whoever was chosen first on the list. Now, the recordset is set to nothing and the mail object is set to nothing at the end of each mailing. The only thing I don't know how to do is make the "email" object from the following code go away. I mean, if I go to the page of the second possible choice, COLLECT2, and change the "email" to "email2", then it works. I need to know how to make the "email" object go away at the end of each form so I don't have to go throgh all my pages, renaming the "email" object 1, 2, 3, 4 and so on. Here's the code: SQLGETEMAIL = "SELECT email FROM DSAUsers WHERE profile = 'APLINEP'" SET RS = MyConn.Execute(SQLGETEMAIL) Do until RS.EOF = True email = email & RS("email") & ";" RS.movenext loop ' Get rid of the final ; If email <> "" Then email = Left(email, Len(email) - 1) End If ####### Then I use CDONTS to send the mail...now, how do I remove any trace of a page being processed so the next one looks like the first? Does this make sense?
-
Identity Seed/Increment CustomizeCan someone give me an example of how I can customize by PK? Instead of just a number incrememnted by 1 for every row, I want to change it to NUR1, NUR2, NUR3, etc...basically add a NUS in front of it. How can I accomplish this? I am going to have a different ID for different tables, this one happens to be "New User Request", hence the NUR1, NUR2, NUR3, etc. Any thoughts? Someone mentioned an "INSTEAD OF" trigger, but didn't offer any further details on "HOW" to do it. Thanks
-
Whats wrong with this picture?I am attempting to query every table in my database and put the results in a record set, format the results to a cell string in html and print it out. The problem is that it is displaying only the results from the first table it matches to. Am I mistaken in thinking that it combines all results into one RS? If not, how do I accomplish what I want to do? The premise is this: I have several user request forms that output to their respective tables in my SQL Sevrver 2k DB. All the forms have the columns listed in the SELECT stametment below. I want to query all these tables for anything matching STATUS='OPEN' and display the results in a user queue. I have eliminated the HTML from the user queue page just to show what function I am trying to accomplish. Any help is GREATLY appreciated! (I aplogize for the sloppyness of the CELLSTRING & "<>" has been replaced with "[]") ============================CODE=========================== Dim objRS Dim strSQL Set objRS = Server.CreateObject("ADODB.Recordset") strSQL = "sp_MSforeachtable 'select submitDate, requestorLastName, requestorFirstName, urlToForm, nof, status from ?'" objRS.Open strSQL, MyConn if objRS.eof then response.redirect "noQueue.asp" else do until objRS.eof cellString = "[tr style='padding: 3'][td][font face='Arial' size='2' color='#CCCCCC'][center]" & objRS["submitDate"] & "[/center][td][font face='Arial' size='2' color='#FFFFFF'][center]" & objRS("requestorFirstName") & " " & objRS("requestorLastName") & "[/center][td][font face='Arial' size='2' color='#FFFFFF'][center]" & "[a href='" & objRS("urlToForm") & "'][font color='#66CCFF']" & objRS("nof") & "[/a]" & "[/center][/td][td][font face='Arial' size='2' color='#FFFFFF'][center]" & objRS("status") & "[/tr]" response.write(cellString) objRS.movenext loop end if
-
SELECT from multiple tables in a DBThis is a great command. I can't seem to get it to do what I want. I have the command, but it seems to be just "picking" a table out of the database and displaying the properties. I am attempting to display this information in an HTML table. Here's the code: sqlstr="sp_MSforeachtable 'select submitDate, requestorLastName, requestorFirstName, urlToForm, nof, status from ?'" Set results = MyConn.Execute(sqlstr) submitDate=results("submitDate") requestorLastName=results("requestorLastName") and so forth for each column... I have approx 50 tables, and my html output only displays entries for only one of the tables...what do I need to do to be able to query all and display all for whatever table matches the query? Thanks