655 Posted Topics
Re: If you can't figure out what the error is, what makes you say it is wrong? Were you told it was wrong as part of an assignment? Is there some other instruction you aren't sharing with us? Please share your thoughts or reasoning, otherwise we don't know if you've put … | |
Re: When the database is local on the user's computer, you can build the connection string to concatenate with the App.Path object property. When the database is on a shared network folder, you have to either a) make sure the same drive letter mapping is on every computer that's going to … | |
Re: Your request is a little unclear. Can you describe your data scenario a little more? Are you expecting entire rows to be blank scattered throughout the data, or entire columns to be blank in the middle? Or are you simply looking to lop off empty rows from the end, and … | |
Re: Maybe get some other old CD's, a coat-hanger and some thread and make a mobile or a wind-chime? :-Þ | |
![]() | Re: "Sabriel" and "Lirael" both by Garth Nix. Blame my daughter. :-) |
Re: Use the ADODB object library to establish a connection, create a recordset, execute the SQL statement you want and retrieve the records. There are some pretty good examples in the VB help file. Just search for "ADODB". | |
![]() | Re: As near as I can tell, the problem is that the variable "index" defined at the module level is never set to an explicit value. You reference "index" on line 40 above, testing it for a value not equal zero. Fair enough, but it never gets set anywhere else to … |
Re: A little more detail is required. Where does the value in variable srcDate come from? How are the update values being supplied? What are you updating the column dbo.tblCPI.VariableValue to? Depending on the answers to those questions, a solution could vary wildly. One little pointer, though: you seem to be … | |
Re: While we won't do your homework for you (we do ask that you make at least an attempt!) I can give you some hints: In a "For" loop, you can have a negative "step"...in a While loop, you can initialize your counter variable to something besides zero...same thing in your … | |
Re: You could do it in several ways. One simple way is to just disable the button so it can't be clicked again. Another way is to set a value in the "Tag" property of the button, then check it every time and only allow adding if the Tag has no … | |
Re: That's fine, as long as you have explicit line breaks on every line in your text. If you have a multi-line text box without horizontal scroll (a.k.a. "Word Wrap"), it gets way more complicated. You have to use some Windows function calls to get the text metrics for your textbox, … | |
Re: I'm gonna have a whack at this. Give me a few minutes. | |
Re: Try this: If IsNull(DLookup("[empid]", "[employee]", "[empid]= " & txtemplid.text)) Then This assumes, of course, that txtemplid.text is numeric, and that [empid] is numeric. | |
Re: Your post is a little confusing. Let me paraphrase to see if I understand what you're after. 1. You have a table that includes two columns: OrderFormNo and CashBillNo. 2. You have a row in the table with values OrderFormNo=123 and CashBillNo='ABC'. 3. You want to make sure that every … | |
Re: So what have you tried already? Please post it. We will be happy to help with your code if you're stuck, but we don't just write programs on request. | |
Re: There are so many questions about your code...where to start? Okay, so, in no particular order: What is the datatype of the HoursTotal field in Table1? If it's a datetime and you want to manipulate it in your VB code, then you'll probably want to look at some of the … | |
Re: A couple of observations about your scenario, then a couple of questions. Observations: 1. There is nothing in the data to tell you the time when a shift starts or ends. That means you have to hard-code it somewhere, which makes it difficult to add shifts or change start/end times. … | |
![]() | Re: Up votes, down votes Smile votes, frown votes. Votes for good posts, votes for bad posts Even votes for some Geek's Lounge posts. Votes give good rep Votes give bad rep Good and bad and sad and glad rep Members vote posts as they should, Infraction points for "not so … |
Re: Okay, so there are a couple of things going on here. 1. Your SQL statement as written will include ALL records. (If the Employee_ID = 2674930 then it doesn't equal 2267421, therefore is included...and vice versa.) You should have something like this: WHERE Employee_ID <> 2674930 AND Employee_ID <> 2267421 … | |
DaniWeb is great, and I really like the new incarnation. But there are some kinds of functionality that didn't get re-implemented. The specific one I would like to see brought back is that you could click on the "New" button next to a thread (or the purple "bulls-eye" for threads … | |
Re: You simply neglected to change the criteria on the two parts of the CASE clause. Look at this: SELECT source, unique_contact_code, bxl_amount_paid, Date_ABC_Updated, (Case WHEN Date_ABC_Updated IS not null and Subscribed_to_Business_XL = 'SUB' then 'Active' -- <------ Notice this! when Date_ABC_Updated IS not null and Subscribed_to_Business_XL IS null then 'Inactive' … | |
Re: A 424 error indicates there is either a reference to an uninstantiated object variable, an attempt to perform an invalid operation on an object (such as assigning a value to a read-only property) or a missing DLL/component file. All this information can be found in the VB help file by … | |
Re: This is kind of a shot in the dark, but I notice that the format of line 39 seems to be different from the formats of the subsequent 7 lines. Could it be that the error message is a symptom of THAT rather than a problem with the actual data … | |
Re: > I only made one mistake in my life, that was when I thought I was wrong, but I was wrong about that. So this is a case of "two wrongs make you write"? Ba dum bum... | |
Re: You can use the "EXEC" statement in your procedure to dynamically build the necessary statement. create procedure creadatabase @db_name varchar (10) as exec('create database ' + @db_name) go That being said, you might consider carefully before you allow just anybody to run this procedure. The possibility of people creating databases … | |
Re: I assume the code is erroring out on line 3? If so, you could always use one of the conversion functions like CDbl to convert rs.Fields(0) to a Double. You might also consider using the "val" function. The drawback is you might run into truncation issues. I'm not that familiar … | |
Re: If you want to create a brand-new table from the results of your select, you can use this syntax: SELECT blah, blah, blah INTO dbo.myNewTable FROM dbo.IASubscription The drawback with this approach is that sometimes the datatypes you wind up with may not be the ones you would choose if … | |
Re: Also, your SQL statement is probably not well-formed. You should be concatenating the literal with TWO SINGLE-quotes and a couple of concatenation symbols It should look like this (assuming MSSQL is your dbms): sql = "SELECT Position from tblLogin WHERE username = ''" & txtUsername.text & "''" | |
Re: Actually, there is an object in SQL Server called a Check Constraint. You can use it to put all kinds of restrictions on columns. Here's what you would use: CREATE TABLE tblstudents ( studentID int identity(1, 1) NOT NULL primary key, lastName VARCHAR( 20 ) NOT NULL, initial CHAR( 1 … | |
Re: You have to use the "memberOf" query segment (with the appropriate exclamation-point to indicate "NOT") in your filter statement. Here's a sample (names changed to protect the innocent): $Searcher.Filter = "(&(objectCategory=person)(objectClass=user)(!(memberOf=CN=Domain Admins,OU=High Security Access Groups,OU=Information Technology,DC=corp,DC=myDomainHere,DC=com)))" If you aren't that familiar with using LDAP queries, you should read up on … | |
Re: No, SQL Server doesn't care about line breaks. Line breaks are for readability only. However, having the string built in your app like this: mySQLString = "create procedure dbo.myProc" mySQLString = mySQLString + " @inParm varchar(10), @outParm varchar(10)" mySQLString = mySQLString + " AS" mySQLString = mySQLString + " begin..." … | |
Re: You might consider changing the parameter "pPassword" to IN (it's set as "OUT" right now). | |
Re: Depending on how you want your results, you could use this: Me.Text1.Text = Replace(Me.Text1.Text, "*", vbCrLf) This will change the string in-place, but you have to make sure your text box is Multi-Line. Otherwise, it will just display as your string punctuated with unprintable characters. If you wanted to break … | |
Re: If you look at line 28, you should see that you're trying to open an already open recordset. You shouldn't need to do that. What is it you wanted to happen there? Refreshing something? | |
Re: You can do it a couple of ways. If the tables all have the same columns and datatypes, you could do it with a UNION operator, like so: SELECT * from Tab1 where PRNO = 500 UNION ALL SELECT * from Tab2 where PRNO = 500 UNION ALL SELECT * … | |
Re: Your request makes no sense. If you wanted to select for distinct EVA_ID you'd just write "select distinct EVA_ID from myTable" and be done with it. TrayID wouldn't even come into the mix, and any duplicates get collapsed into a single line. There seems to be a bit more constraining … | |
Re: Your explanation seems to make no sense. Do you have 2 tables or 3? It looks like 3: tbl_Class: class_id (pk), class_name tbl_Divisions: division_id (pk), division_name tbl_class_division: class_division_id (pk), class_id (fk), division_id (fk) Next, you don't say whether the number of classes you pass is dynamic or not. If it's … | |
Re: Well, you have several things going on here, but I have questions as well. First things first. Does your database have a FileStream filegroup added to it? If you look at the DatabaseProperties, under the Filegroups page, you should see it in the bottom list of filegroups. The top set … | |
Re: Not sure quite what you're asking. If you mean. "I want to click a button, show a message box and unload my form depending on what the user's response is", then you would just use the MsgBox function to get a return value, then decide what to do from there. … | |
Re: One other little item. If you wanted to use "LIKE" to apply your selection criteria, you'd need to use a wildcard character such as an asterisk for MSAccess or a percent-sign for SQL Server to properly get all the User_Names which contain the text from the text-box. So, for example, … | |
Re: Please notice that you are calling your function on line 20: AddUserFun(Acc_Lvl, user, passwd) and your function declaration is: Function AddUserFun(ByRef user, ByRef pass, ByRef acclvl) As Integer Notice that the order of the parameters is different. Fix that, and I think you'll be fine. Good luck! | |
Re: If you smoke while programming, that means you're typing too fast. <rimshot, please> | |
Re: Not familiar with that dbms. I know you said you can't use functions, (even string functions? Yikes!), but have you considered just unloading your data into a flat file, making your changes there (programmatically?), then reloading your data? I don't know how realistic that is, as in data volume, but … ![]() | |
Re: You might also consider left-joining to transfer. It tends to perform better: SELECT count(*) from Inquiry Inner Join Inquirer on Inquirer.ID = Inquiry.InquirerID_fk left join Transfer on Inquiry.ID = Transfer.TransferInquiryId_fk WHERE Inquirer.Program = 'value' AND TransferInquiryID_fk IS NULL Generally speaking, your query has to resolve the sub-select for each row … | |
Re: You need to supply more information. Such as: What is the actual subroutine/function declaration? What is the actual statement that gets the error? What are the actual control names? What are the actual column names ("Date_Registered" <> "Date_Registred" <> "Date_Regitered")? You can't seriously expect help if you don't supply real … | |
Re: Your request is a little...confusing. And, you didn't post the statement you are actually using. It's kind of hard to help when you don't include it. However (and I'm going out on a limb here) it sounds like your update statement isn't using a "where" clause to isolate the one … | |
Re: Seems like you're mixing and matching your questions here. Notwithstanding the code syntax error (can we assume since you're using "DIM" then it's VB?) and the unwise use of reserved words ("table" and "name"), you aren't separating your statements with either a statement terminator (such as ";" or a "GO" … | |
| |
Re: There are several very good sections about it in the Help file. If you just want to use an ActiveX control, go to the Project/Components menu item, and select "Microsoft ADO Data Control 6.0 (OLEDB)". Plop one onto your form and set the properties. If you want more control over … |
The End.