713 Posted Topics
Re: What's to stop the user from just closing the window? or clicking start or using a keyboard shortcut for windows explorer or run? If you are interested in disabling all the above then you are not talking about a form, but a different shell. If I judge by this thread: … | |
Re: urtrivedi is correct - at least up to the point of automatically joining the tables. Access lists objects in a particular order: Table, Query, Form, Report, Macro, Module. This is the same order you've got to follow when creating a new db. Start with the data you want to store. … | |
Re: [QUOTE=jtodd;1701456]Thank Plasma! I tried the code below and when I try to run it the datagrid is still blank. Any thoughts? Am I doing something wrong? Thanks again for your help! [CODE] Imports System.Data.OleDb Public Class Form1 Private Sub DataGridView1_Click(sender As Object, e As System.EventArgs) Handles DataGridView1.Click Dim ds As … | |
Re: put single quotes (') around 0097 and you'll be fine. By using 0097 like this you are not handling it as a string, but as a number - so the 0s don't belong there and get truncated | |
Re: Read here: [url]http://msdn.microsoft.com/en-us/library/system.math.ceiling(v=vs.71).aspx[/url] | |
Re: If you are expecting only 1 value and you are not really binding -let's face it you are just trying to assign a value - why are you using a datatable? Wouldn't it be easier to use an ExecuteScalar and get the value you are looking to assign to the … | |
Re: What is the type of cells(0)? Would it have a true/false as value ? Have you tried to step through the program and determine what is wrong with your code? | |
Re: 1st of all this thread is 5 months old. I hope OP found the solution already - if not try with the group by as everybody suggested. Back to your solution: How would a view resolve an issue with a select statement? A view is used to a)simplify a complicated … | |
Re: You can assign each datagrid to a different bindingcontext. [QUOTE] If you want to have multiple BindingManagerBase instances for the same data source, create a new BindingContext and set it to the BindingContext property of an object that inherits from the Control class. For example, if you have two BindingManagerBase … | |
Re: I'd use the OUTPUT clause with an update. You can find more information here: [url]http://msdn.microsoft.com/en-us/library/ms177564.aspx[/url] I'd suggest you read the whole page, as there are a few drawbacks, ie: [QUOTE]An UPDATE, INSERT, or DELETE statement that has an OUTPUT clause will return rows to the client even if the statement … | |
Re: The noob way is to create the textbox, with visible=False and change visibility on button click. If that won't do for you, read here : [url]http://www.daniweb.com/software-development/vbnet/threads/318076[/url] or here: [url]http://www.daniweb.com/software-development/vbnet/threads/101111[/url] | |
Re: How are you going to use this insert? Is it going to be part of a program that will insert a record or part of a procedure/query or whatever that will update all/some records from the costs table? The reason for asking is that if this is a program then … | |
Re: This doesn't change what you've got to put in the stored procedure. It just might affect the way you handle it from your program. Make the changes that BitBit indicated and if you have a problem with your program open a thread in the appropriate section of the forum. | |
Re: If the only difference between the builds is the connection string, why don't you build a form that would allow you to change the connection string in the compiled apps? It doesn't have to be anything fancy, just which one is the "active" one. I'd expect this to be in … | |
Re: [QUOTE=urtrivedi;1694729]you need to create after insert trigger on employee table, in which you should write update statement for department table update department set no_of_employees =no_of _employees+1 where dept_id=new.dept_id then you create delete trigger update department set no_of_employees =no_of _employees-1 where dept_id=old.dept_id then you create update trigger update department set no_of_employees … | |
Re: The function you need is month(). [CODE]select * from Student_transport_Details where month(StartDate) = 1 or month(StartDate) between 6 and 10 or month(StartDate) in (2,4)[/CODE] | |
Re: @pritaeas this will sort the records descending, but won't select only the latest date. Edit: It won't do even that as you are grouping by item_code and then sorting by item_code and then by date. This will select only the latest date [CODE]select * from table inner join (select max(date) … | |
Re: I believe that you've messed up your IFs. You've got 2 [ICODE]IF recordExistCom = False Then[/ICODE] and the second of them ends just before the loop. The Else you've got between insert and update will only work for the inner if, and you'll never update. PS: It would make it … | |
Re: You don't need to validate, but to limit the datepicker. Read here: [url]http://msdn.microsoft.com/en-us/library/system.windows.forms.datetimepicker.mindate.aspx[/url] | |
Re: try adding a space before the where and after the double quotes. If this doesn't work get a glimpse of your update by using debug.print and copy/paste it here. PS: Why are you using VBCrLf in the update? | |
Re: I may be wrong, but SelectedRows won't do it for you. SelectedRows is used for rows selected (ie clicked on or multi-selected with Shift or Control pressed while clicking) and not for rows that have been "selected" with a checkbox. I believe you need to change SelectedRows to Rows and … | |
Re: Check this site for all kind of connection strings: [url]http://www.connectionstrings.com/[/url] | |
Re: I'm not sure why you have to write the data in a CSV and then load a second app. If both apps are going to be yours, then why not create a second form and have it read public vars? Have form1 start your 3rd party app and then your … | |
Re: That condition is easily achieved if you add NULL or '' for the missing columns in the query with the fewer columns | |
Re: You shouldn't even need a variable. Add textbox value to subtotal value and you're done. | |
Re: Let me know if this will do the trick for you. [CODE]select a.Roll_id, b.Roll_id from (select Roll_id, ROW_NUMBER() over (ORDER BY Roll_id) as 'RowNumber' from test2 ) a inner join (select Roll_id, ROW_NUMBER() over (ORDER BY Roll_id DESC) as 'RowNumber' from test2 ) b on a.RowNumber = b.RowNumber[/CODE] | |
Re: Just for future reference, your error was here: [CODE] "'," & netInvest & "'," & netInvest & "'," & netInvest & "','" &[/CODE] you are missing single quotes. It will be a lot easier for you to troubleshoot errors of this type by using debug.print sqlStr (or how you call … | |
Re: If I remember correctly you can't restart an Access db as the code that is called to do the start part has stopped existing when then db has closed. I used to use a second db with vba that would open a new instance of the db after x secs … | |
Re: I didn't understand the question either. Can you provide sample data and the expected results? | |
Re: Use the ROW_COUNT() function. Read here: [url]http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_row-count[/url] for more info. | |
Re: This is the way to go: [CODE]update customers set customers.acc_balance = a.inv_sum from customers left join (select cust_id, sum(inv_amount) as 'inv_sum' from invoices group by cust_id) 'a' on customers.cust_id = a.cust_id[/CODE] | |
Re: In my book either all info regarding an event that could change (type of fuel sounds like this) have to get saved with the event itself (ie tank containing jet emptied). If the size of these info along with the number of records repeating them is high, then you might … | |
Re: If I understood correctly you've installed SQL on your local computer and created an instance named MYSQLTESTSERVER1. If this is true then you need to enter localhost\MYSQLTESTSERVER1 as the server name. PS: If you actually renamed your computername to MYSQLTESTSERVER1 then you try localhost or MYSQLTESTSERVER1. | |
Re: [CODE]SELECT DateDiff("n",Now(),[TimeStamp]) AS [Time] FROM RIMData_RAW where DateDiff("n",Now(),[TimeStamp]) > 30[/CODE] | |
Re: I am on the other side of the fence. Soon we won't be using keyboards and commands won't be but buttons, drop down menus and stuff like that. Let's not forget that no matter how powerful or not DOS was it's the GUI that made computers popular and easy to … | |
Re: Contract or no contract I can think of at least 2-3 ways to get away with a big compensation. My advice would be to put into the contract that if you don't get paid within x days you've got the right to bill their credit card. Of course you should … | |
Re: A good step in debugging something like this is to get the actual statement and either run it in the db or at least go through it. use [ICODE]debug.print cmd.commandtext [/ICODE]just before the ExecuteNonQuery and verify that you are running what you think you are. | |
Re: The criteria are being passed to your report as strWhere. Copy this part of code: [CODE] If IsDate(Me.txtEndDate) Then If strWhere <> vbNullString Then strWhere = strWhere & " AND " End If strWhere = strWhere & "(" & strDateField & " < " & Format(Me.txtEndDate + 1, strcJetDate) & … | |
Re: Relate is a bit too generic for me. Can you please describe what you are trying to accomplish? Do you need a foreign key or a join ? | |
Re: Do you want this to validate a user in your app or in Windows? I'm guessing your app, so I'm guessing that you could save an encrypted file in the flash drive and after decrypting it and reading it determine if this is a) a valid file b) a valid … | |
Re: I am not sure what you mean by automatically, so I'm leaving this part out for now. To change the values between the 2 dates from no to yes you need an update query. It should look like: [CODE]update table set status ='yes' where status = 'no' and date between … | |
Re: It looks like you already know about [CODE] Dim cb As New OleDbCommandBuilder(da) da.Update(dt)[/CODE] What seems to be the problem? | |
Re: I'd insert the sheet into a temp table (or a var table for speed) and have SQL pick what it needs with a [ICODE]not in[/ICODE]where clause or an outer join with null values for the table side key columns. This will give you the possibility to verify multiple keys simultaneously … | |
Re: You lost me with the I want to add the values in the column the row. Your code seems only to be adding the second from last row in datagridview, and then you try to add to total the value of row -1 (your counter is 0 and you subtract … | |
Re: For troubleshooting purposes add [ICODE]debug.print strsql [/ICODE] before or after [ICODE]sqlcmd.ExecuteNonQuery()[/ICODE]. This will return (in the output window while debugging) the exact statement you are passing to SQL server, with values and everything. If it looks correct, copy/paste it on your SQL and verify that you get the intended result. | |
Re: I agree with hericles, you have to handle the situation where something goes wrong with the insert. What is your database? If it supports stored procedures, I'd create one, feed the user name and the vote and have it handle the vote. This way even if the connection from the … | |
Re: First of all, you can't possibly lock an administrator out of a folder. To get your data back open window's explorer and navigate to the folder. Right click and select properties, switch to Security tab and click advanced. You can try to change permissions, but chances are you won't have … | |
Re: A database can hold and serve you data no matter where you connect from. Point both applications to the save server and you'll be just fine. No offence, but I read you're going to build a website and in contrast with your question I can't help but think that if … |
The End.