Jump to content

Reg Edit

  • Posts

  • Joined

  • Last visited

Everything posted by Reg Edit

  1. Reg Edit

    Asp and XML

    It's a long time since I did any classic ASP, but... The above line of code allows casuale to be greater than dcircuito1.length. So depending on the data this could result in a null object reference here:dcircuito1_ = dcircuito1(casuale).text Also I think for object assignments in vbscript you need to use set? In which case you would need to change this: banner = xmlbanner.getElementsByTagName.... to: set banner = xmlbanner.getElementsByTagName.... and the same for the other similar lines.
  2. The other thread is here and has already been replied to also. Repeating my reply below for general awareness while both threads are open.Please see here for some info about this which I put in another postIt was a poll in the forum to find out what ways people were using for the IE6/IE7 thing. As well as using the info in that post, also please feel free to cast your vote there and add your thoughts in a reply to that post which may revive interest in the poll. There were not many responses at the time, and I for one am still interested to know what others think.
  3. Reg Edit

    DB Design help

    I would use: Orders table:ord_idcust_idOrderproducts table:ordprod_idord_idprod_idord_quantity That way, anything pertaining to the whole order (and you may well add others such as order_date) is stored once on the orders table, and anything pertaining to an individual product (such as quantity) is stored for each product in the order.
  4. With a listbox in multiselect mode, the SelectedValue property only returns the first selected value. To access all the selected values, iterate through the Items collection and check the Selected property of each item:foreach (ListItem li in ListBox1.Items){ if (li.Selected) { // Use li.Value here }} If you want to know more about accessing the database, see the ADO.NET referencehttp://msdn2.microsoft.com/en-us/library/h...021(VS.80).aspx
  5. Please see here for some info about this which I put in another postIt was a poll in the forum to find out what ways people were using for the IE6/IE7 thing. As well as using the info in that post, also please feel free to cast your vote there and add your thoughts in a reply to that post which may revive interest in the poll. There were not many responses at the time, and I for one am still interested to know what others think.
  6. With your Windows hat on, however (as opposed to your Red Hat), have you considered using PHP under IIS:http://msdn.microsoft.com/msdnmag/issues/0...default.aspx#S1http://www.google.com/search?q=iis+phpThis is not something I've investigated. But I would have thought that using IIS rather than Apache may give you the ability to use impersonation when running your PHP scripts.
  7. True, but when you use impersonation, you can use any credentials you like, not necessarily those of the logged-on user. As long as you have established the means to associate a set of credentials with the current context (domain in this scenario), you can execute everything using the applicable credentials. But anyway, for boen_robot, off down the open-source road, this is probably academic.
  8. Yes, that's true, when you use anonymous authentication in IIS and allow everything to execute as the anonymous user (IUSR_machinename). But on the other hand, if users log on to your site, you can elect to use impersonation, whereby you can supply the credentials of the logged-on user to execute processes under that user's account.An example would be, before a webservice call, setting the credentials property of the webservice proxy. The webservice then executes using the account identified by the credentials, and its authorization to access resources such as the file system is dictated by the permissions granted to that user.However, boen_robot, if you abandon IIS for Apache, I imagine PHP scripts invoked by Apache will always execute under the account you have set Apache to run under.Probably best to go completely one way or the other--MS or open source.
  9. The workgroup information file is the System.MDW file. Either you are locking the application out by running Access at the same time yourself, or the file cannot be found by the application. http://support.microsoft.com/kb/305542My suggestion: rather than jumping through hoops like this with Access, consider diverting your efforts towards moving to SQL Server or mysql instead. Both are available as a free download and offer a much better database platform than Access.
  10. Reg Edit

    Foreign Keys

    Not so! A foreign key can be optional by allowing nulls. This preserves referential integrity because the foreign key must be set to an existing id or null. Try this:CREATE TABLE categories( id INT NOT NULL AUTO_INCREMENT, name VARCHAR(50) NOT NULL, description VARCHAR(255) NULL, mother INT NULL, PRIMARY KEY (id), FOREIGN KEY (mother) REFERENCES categories(id)) ENGINE=INNODB You can then insert records: insert into categories (name, description) values ('n1', 'd1')insert into categories (name, description) values ('n2', 'd2') And you can then set mother. In the case where you have inserted records with ids 1 and 2: update categories set mother = 1 where id = 2
  11. Actually, I think the point is: certain data and certain logic is required to calculate rank. The data is all in the database. The logic could be implemented right there in the database too. Any optimization strategy you have in mind must be possible there too. Clearly you have strong feelings against doing this in the database (and we technical types do tend to produce strong feelings, don't we!) but, with all due respect, you have not produced any technical justification for doing this work on another server. So however impressive your code is on that server, with constructors taking vectors of ids and so forth, you will still, I think, produce an inferior performance compared to doing it in the database. And as well as increasing number of database calls, and increasing network traffic, you will also introduce the unneccessary complexity of integration with 3rd-party/custom sorting code, with consequent maintenance implications, when the database already offers what you need out of the box.So I urge you to reconsider! And unless you can in fact produce concrete technical justification for your current approach, showing why it will help performance, my own recommendation remains the same: implement getRank() in the database, and do the sort in the query.
  12. Reg Edit

    Foreign Keys

    Allow nulls in the mother column. That will allow you to load the data, and you can set the mother values afterwards.
  13. Looks likely to be an equally valid way, and there are sure to be many others. Just make sure it tests correctly, performs adequately, and is comprehensible to people who'll need to look at that code in the future and understand what it does... Note that you haven't excluded yourself from the results, so if that is a requirement, then you still need that extra condition I suggested at the end. (Try it with 4 instead of 2 and you'll see that 4 is included in the results.)
  14. OK, but as I say, if it brings your site down, is it throwing an exception, because if so, you need to look at the details of that exception in case there's something you need to handle better in your code. For instance, I can see that if your For loop exits with no alerts, then two uninitialised string variables get used, which would cause a null reference exception. So you should initialise those two when you declare them: Dim strAlertTitle As String = String.Empty, strAlertDescription As String = String.Empty Anyway, if you do use a try/catch then it would look something like: Try ' load live xml hereCatch ex As Exception ' live load threw an exception: load the default xml hereEnd Try
  15. Probably a few ways to do it, but how about something like this. I've called the table friends:declare @me intset @me = 1 -- example value only--set as requiredselect distinct fofof.frienduserid from friends finner join friends fof on fof.owneruserid = f.frienduseridinner join friends fofof on fofof.owneruserid = fof.frienduseridwhere f.owneruserid = @me and fofof.frienduserid not in (select fof2.frienduserid from friends f2 inner join friends fof2 on fof2.owneruserid = f2.frienduserid where f2.owneruserid = @me)and fofof.frienduserid not in (select frienduserid from friends where owneruserid = @me) Assuming you may also want to exclude yourself from the results, you'll need to add a further condition: and fofof.frienduserid <> @me
  16. As these pages are in different folders, then depending on how your site is defined, I wonder if you're navigating beyond the scope of the cookie by going to another domain/subdomain etc. Try putting both files in the same folder.
  17. Reg Edit


    If it works with "~/Msn.jpg" then the file is in the application root folder. That explains why you don't see the file when browsing the App_Data folder.
  18. Probably needs some exception handling to solve this. When you say it brings your site down, is it throwing an exception when trying to load/use that xml document? Add a try/catch around that code, and code your default xml load in the catch.
  19. I seem to remember the default user is "Admin" in an Access Db? Try that.
  20. Reg Edit

    What is New On Sql

    Lats: the latissimus dorsi (plural: latissimi dorsi) is the large, flat, dorso-lateral muscle on the trunk, posterior to the arm, and partly covered by the spinotrapezius on its median dorsal region.Compound exercises for the 'lats' typically involve elbow flexion and tend to recruit the biceps brachii, brachialis, and brachioradialis for this function. Depending on the line of pull, the trapezius muscles can be recruited as well; horizontal pulling motions such as rows recruit both latissimus dorsi and trapezius heavily.But I don't think sql can test lats.
  21. What it's saying is that you need to place your <input> inside one of those other elements referred to, instead of directly inside the form. So for instance, putting them all inside a <p> element makes it valid: <form action="mailer.php" method="post"><p> <input type="text" name="name" value="Name" /> <input type="text" name="email" value="E-mail" /> <input type="radio" name="radio" id="radio" value="radio" /> <input type="radio" name="radio2" id="radio2" value="radio2" /> <input type="submit" name="button" id="button" value="Submit" /></p> </form>
  22. The database still gets my vote. If you pull all the data to another server for filtering and sorting, performance is going to suffer, not improve. So you should avoid doing that unless it's completely unavoidable. An it doesn't sound as though it is unavoidable: So my recommendation remains the same: implement getRank() in the database, and do the sort in the query.
  23. Well, that depends on what you actually want the query to do! What data do you want it to return? A count, a set of rows, or what? Perhaps if you could give an example of some data you'd like to see returned from your query, we can suggest the right fix.
  • Create New...