Jump to content

kansasprog

Members
  • Posts

    23
  • Joined

  • Last visited

Posts posted by kansasprog

  1. Clientside vbscript will only work for Internet Explorer browsers instal4l4e4d on windows operating systems.

    Hello,I seem to be having some trouble with my VBScripts. It's not just mine. The problem persists even when viewing the example scripts on the W3 Schools main website. And as well as this, the scripts do not work in my live preview editor. I've tried all the browsers I own (Firefox, Opera, Camino, and Safari), and yet still no luck. The problem is this: document.write() doesn't work. I cannot know if the rest works because it will not write anything. Apon viewing the source, it shows the VBScript in the <script type="text/VBScript"></script>. I cannot figure out what the problem is. Is this a known bug, or is it me?If this will help, I'm on Mac OS X 10.4.8. Though, it shouldn't matter.Help would be much appreciated.--EDIT--I tried IE as well. Version 5.2 for Mac.
  2. I'm having exactly the same issue, actually. IIS is definitely running (service is activated), but in my IIS Manager I'm only seeing the "Web Sites" and "Default SMTP Virtual Server" nodes. I'm running XP Professional.-A
    This might help. Go to IIS>Websites>MyWeb.1) right click on Myweb.2) properties. 3) I am not sure exactly what is says, But you have to create the MYweb as application.4) if already created, Remove and Recreate again. 5) Now browse to the page and see. http://localhost/MyWeb/test1.asp
  3. I am quoting a clear example of the Junction table, in Northwind sample database.When employing this database in a DataGrid, I receive DataConstraint Exception Error in the Junction table "Order Details" or in the "Orders" table, with the following error message:"Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints."On displaying one of the errant tables, each row complains as below:"ForeignKeyConstraint, Shipper_Order (for example) requires the child key values ????? to exist in the parent table.NOTES: 1- I established Relations just according to the ones in MS Access application.2- The Same Database is Functioning normally inside MS Access application.3- I am mainly concerned about the Junction table.I need professional guidance as this is a study project, I am working on.

    ForeignKeyConstraint, Shipper_Order (for example) requires the child key values ????? to exist in the parent table. I think its a database issue . the junction table might have an id where it doesn't exist in the parent table.When you are trying to delete records in the database , delete them in the child table and then in the parent table. If we dont keep track of such things integrity might fail.
  4. ISSUE 2The reason why the form doesn't reset is because it isnot posting to the window in which it is loaded.  As you said, it posts to a <iframe> so the parent window has no reason to reset it.So, you'll have to write a little javascript that is called from the "onclick" attribute (which you will need to add) of the submit button.  The script will set the value of the two field in your form to "".(you'll have to give your form a name)Kind of like this:onclick="document.formname.formfield.value='';"P.S. Your site doesn't render well in Firefox.

    I foresee a problem if we reset the values for textfields to "".Since the values are reset will they still be available in the next page ?
  5. I need to include a column in an SQL Server table, which can hyperlink to some text stored somewhere inside or outside the same database.My ultimate goal is that when I view the table in a control, DataGrid for example, and click that link, it should take me to the destination link or open the linked file.Please help.R. A. Abbasi

    Go to datagrid properties builder and u can format ur columns over there. drawback to this is. U have to make sure the links are right in your sqlserver database. U can also set your target as _blank to open in a new page.I dont remember the exact options which you have .. but u have a hyperlink column over there. If you are still stuck . let me know i can help you with a sample.btw.. is this a datagrid control for webpage?
  6. <HTML><HEAD><FONT FACE="ARIAL" SIZE=2 COLOR="#13428E"><script type="text/vbscript">dim aa=Array("MONITORs", _"CPUs", _"KEYBOARDs", _"MOUSE", _"USB", _"HARDDRIVE", _"MP3Players", _"-")document.write("<table border=1>")document.write("<tr><td><FONT SIZE=2 COLOR=BLUE>" & a(0) & "</FONT></td></tr>")document.write("<tr><td>" & a(1) & "</td></tr>")document.write("<tr><td>" & a(2) & "</td></tr>")document.write("<tr><td>" & a(3) & "</td></tr>")document.write("<tr><td>" & a(4) & "</td></tr>")document.write("<tr><td>" & a(5) & "</td></tr>")document.write("<tr><td>" & a(6) & "</td></tr>")document.write("<tr><td>" & a(7) & "</td></tr>")DOCUMENT.WRITE("</table></FONT>")</script></HEAD></HTML>

  7. Im not using vbscript, just standard SQL, would the above solution be the same.

    ok... You want to query a database and show all the results in a table in asp( I assume u mean active server pages).Do you know what language are you writing your asp pages?If you are writing in VbScript... , set your connectionset your recordset set your sqlstatement. ( if your sql statement has multiple lines use the above syntax)query the database. get the results of the query in a recordset. loop through the recordset to write to a page.
  8. My friend and I are trying to make a application form for our school. We have found out that the way were going to need to do it will require some database work. We are currently try to get a hold of a server that will allow us to do what we need. This form is for applying to our high school/collage program. We need to beable to make a form using a program or by hand. So that it saves a copy to our server and depending on what they chose sends a copy of it in a readable format to one of 3 places. If anyone has done or knows of a way to do this that would be great.  Any suggestions would be great.

    Can be done in several ways... Do you guys know which language are u going to use. I assume its a web application.What kind of server are you planning to use.
  9. Hi ive got this query below and the table is in SQL Plus,select sum(d.price), e.Title, d.dvd_idfrom dvd_rental d, dvd_details ewhere ORDER_DATE between '4-NOV-04' and '04-NOV-05'and e.dvd_id = d.dvd_idgroup by d.dvd_id, e.titleorder by sum(d.price) descI want to use ASP to simply display the contents in a table using ASP, i know how to do this, but this is a long query how do i insert this query into the ASP, i tried to put it on multiple lines but at the end of the first line theres an error how do i make it so it reads the whole query.

    Assuming you are asking to concatenate your sqlstatement in vbscript.. Look the sample below.. use _ at end of first line and an & at the start of second line.strSQL = "select sum(d.price), e.Title, d.dvd_id"_&"from dvd_rental d, dvd_details e"_&"where ORDER_DATE between '4-NOV-04' and '04-NOV-05'"_&"and e.dvd_id = d.dvd_id"_&"group by d.dvd_id, e.title"_&"order by sum(d.price) desc"
  10. set i = MyConnection.Execute("SELECT Count(name) AS Expr FROM table1")try without single quotes in name, butIf you could post the error, it will be easy.

    I would do something like this .. <%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open(Server.Mappath("northwind.mdb"))set rs=Server.CreateObject("ADODB.recordset")sql="SELECT * FROM Customers"' you can change your sql statement based on a condition too !!!!rs.Open sql,conn i=rs.RecordCount response.write("The number of records is: " & i)rs.Closeconn.Close%>
  11. Dim str As String = "Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=dbname;Data Source=servername;"Dim MyConn As New SqlConnection(str)MyConn.Open()When I open in the local host, I am getting the following error. guessing it as some IIS problem, but cant figure out....ERROR:Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

    Dim str As String = "Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=dbname;Data Source=servername;username=username;password=password"Did you include username and password?Specify username and password for the above database and it should work fine.. You need to create username and password for the database for accessing data.
  12. Hello I have sucessfully made a connection of ASP with MYSQL.Is there any replacement to Rs.RecordCount as it is not working in this connection. There is no error returned the value returned is -1.Can any body tell me alternative to that.

    I would use Rs.Recordcount if its an access or sqlserver databases.. You can loop through your recordset and increment a variable.. to find your total records in that recordset.. while not rs.eof count = count+1 rs.movenextloop
  13. Situation: in an ASP page i have created i read a table and i display an ID from the table then i have a button and when i click on a run a new query  and  then the window has to be closed. (This page is an example page made it to specify my problem)The problem: when i click the button the btnsave_onclick proc is executed but if i insert the commands to open my table it is non completely executed. If i leave only  a msgbox("HELLO") and a window.close commands there are non problem. If i insert all the rows to create a connection i don't see the msgbox("HELLO"); another problem is that i have set some Application variables in Global.ASA and normally i can read them from vbscript code buto in this proc i can't read them. Where is my error ?I put my asp page code.Thanks in advance for help. :) <script  LANGUAGE="vbscript">Sub btnsave_onclick// Is this an ADO Object.. if so it has to be set dbconn = CreateObject("ADODB.Connection") dbconn = CreateObject("ADODB.Connection") nice example on w3schools. http://www.w3schools.com/ado/prop_conn_connectionstring.aspDid you store your database connection in application variable....Application(Aupd_connectionstring")[/ ' from here commands are not executed'and variables are non readdbconn.ConnectionString = "Provider=VFPOLEDB;Data Source=c:\inetpub\wwwroot\acut\database\Aupd\;Collating Sequence=Machine"dbconn.Open "",""'dbConn.ConnectionString = Application(Aupd_connectionstring")'dbconn.Open Application("dbconn_RuntimeUserName"),Application("DbConn_RuntimePassword")SQLQuery= "Select * From Usrs" msgbox("HELLO")window.CloseEnd Sub</script><%cId = Request.QueryString("Id")Set dbconn = Server.CreateObject("ADODB.Connection")dbconn.ConnectionString =Application("Aupd_connectionstring")dbconn.Open Application("dbconn_RuntimeUserName"),Application("DbConn_RuntimePassword")SQLQuery= "SELECT Usrs.Id, Usrs.psw, Usrs.Cli, Usrs.Mail, Usrs.Tipo, Usrs.Area, Usrs.Act " & _  "From Usrs " & _  "Where Id='" & cId & "' " & _  "order by Id"Set RS=dbconn.Execute(SQLQuery)%><html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><title>Test</title></head><body><% Response.Write(Rs("Id"))%><p><STRONG><FONT face=Tahoma color=dimgray size="2">    <INPUT id=btnsave type=submit value="Conferma"></FONT></STRONG></p></body></html><%dbconn.CloseSet RS=Nothing%>

  14. I removed my primary key (which was set as a uniqueidentifier) and the insert works just fine. So I guess my question now is "how can I append a unique ID to each record during the insert process?"-Luke

    Why dont you use the ADO Record set to add new records.set conn = Server.CreateObject("ADODB.Connection")set rs = Server.CreateObject("ADODB.Recordset")rs.open "table",conn ' not sure something like this... rs.addnewif you have a primary key and its an unique key with autonumber,you dont have to specify here.. recordset takes care of it. (Do you have primarykey as a autonumber in your database)rs.fields("yourfieldname")rs.fields("yourfieldname1")rs.fields("yourfieldname2")and so on.... 'remember to update it.. rs.Updaters.close set rs = nothing and now close your connection... it should work
×
×
  • Create New...