
kejpa
Avatar/Signature-
Posts
321 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by kejpa
-
Sorting a Database Alphabetically [C#]
kejpa replied to Shaitan00's topic in Database / XML / Reporting
Sorry, can't help you. I've never done any database handling with Excel, I'm always convicing the people that think Excel is a database that it's not and show the benefits of using a "real" database engine. Good luck! /Kejpa -
Somehow it seems like the ODBC-driver thinks the string ends at \0. Could it be that it treats those two characters as end of string delimiters? If I were you I'd use a parameterized query instead of what seems like a concatenated statement. There are lot's of threads here about parameterized queries HTH /Kejpa
-
Sorting a Database Alphabetically [C#]
kejpa replied to Shaitan00's topic in Database / XML / Reporting
I think you're only able to do a permanent sorting in Excel. Access and SQL server are database engines and they keep their own sorting based on the primary key and things like that. /Kejpa -
You could do an insert ... select which inserts record(s) based on your select statement. HTH Kejpa
-
Disk space is cheap. Wildcard table scans are expensive. I'd go for one keyword per record, the only overhead storage is the imageId. Your where clause should be m.[description] like 'bird%' You're missing the quotes around the string to search for. Another thing... Avoid using sp_ as prefix to your stored procedures. If you're unlucky enough M$ comes up with a system stored procedure with the same name and yours will never run, not even when prefixing it with your database name
-
From my point of veiw IdKeyword looks like an Identity field , right? Not too sure you need it, IdImage and Keyword would make a good primary key. The structure you have is right just keep one keyword in each record. Which will be able to give you a query like... Select i.* from Images i inner join Keywords k on k.IdImage=i.IdImage where k.Keyword in ('city', 'bird', 'forest')
-
Hi, reading in the Reference manual for mySQL I find that a BLOB is treated as a text field and thus you probably should add quotes and escape certain characters... Have a look at the reference manual (chapter 6.2.3.2 in my version 3.23.54) HTH /Kejpa
-
Not too sure, but I expect the Path to be the problem, I would have escaped the \ What happens if you do .... INSERT INTO FilesDB (Path) VALUES ('C:\test')"; ? You seems to be in control of your database, do some testing using a database GUI... HTH /Kejpa
-
SQL server Books online isn't really a book it's all the help you ever needed for handling SQL server in help files probably already installed on your computer. Look for it in the same place under the Start|Programs|SQL Server(?) as you use to start Query Analyzer. /Kejpa
-
Hi! I'm not so sure you can... The only way I know of is to read the table just after the insert is done. But there is one catch... Access isn't a multiuser database by design and thus there are no functions to handle such things as multiple inserts at the same time. Rows will most likely be inserted but you can't be sure that you're the one that inserted last record. You could try to use transaction handling to insert, retrieve the record with the latest ID and try to match your values with that record and commit if they match and rollback if they don't and loop until you're done. Ought to work but I haven't tried it, only use Access for single user applications. HTH /Kejpa
-
I guess the easiest way is to use backup/restore feature of SQL server. Management Console window should help you, if not SQL server Books online is your friend. HTH /Kejpa
-
Hi, I would suggest this little nifty trick... Make a new text file on your desktop. Rename it to "WhatEverYouLike.udl" Double click it and you will get a wizard helping you to connect to your database. Once the connection is tested and functional open the udl-file in notepad and voilá there's your connection string. Copy and paste into your module and make the necessary changes for database location and such... HTH /Kejpa
-
How can you store date/time in MSSQL in datetime format?
kejpa replied to trend's topic in Database / XML / Reporting
Your string will be like INSERT INTO DateTimePayload (Date) Values(date1) try instead Dim myInsertQuery As String = "INSERT INTO DateTimePayload (Date) Values('" & date1 & "')" and you will get INSERT INTO DateTimePayload (Date) Values('2005-10-03') hth /Kejpa -
In some sense yes. Access use diskspace for this, a small database where you have made a number of deletes, inserts and updates can easily be over 10MB then when you compact it it shrinks back to fit a diskette. SQL server (SQL is a language you talk to databases with) uses some other means for detecting "freed space" Haven't studied how mySQL does it, I nowadays always use primaries (<LOL> yeah, right!) /Kejpa
-
Hi, if you have any control at all over the hardware sending the data put in delimiters and most of your problems are solved. VB2005 supports Serialports, maybe you should switch environment, and if you can't there is some free code manageing serialports for VS, quite good and customizeable. It seems to me like it's quite easy to get the information as soon as you know where to start reading, 1st byte indicates number of databytes. If it's not too heavy sending you can assume that the string you get from MSComm is the full length message. Transmissions with that little data is fairly quick and unless it's a flooding stream of byte jumping at you as soon as you open the communication ports there will be a short break between the messages. You can use that information to assume that there soon will come a start of a new message. HTH /Kejpa
-
As I said, I've never used DB2 my experience is from Access, SQL and mySQL. If you insert three records they appear as 1, 2, 3. If you then delete #2 and insert a 4th and a 5th the order usually will be 1, 4, 3, 5. Records are inserted where there is "empty" space, if there is no primary key defined. So there's no telling which row was inserted last :( HTH /Kejpa
-
Don't know much about DB2 and RID's. By using simple SQL you can't distinguish between identical records. If you try to delete one you delete'em all. Some database engines support "top"/"limit" or other keyword for restricting the number of affected records, the DB2 syntax and options am I unfortunately unaware of. /Kejpa
-
The easiest way is to use a primary key. ALL tables should have a primary key, or at least a unique. How else can you distinguish between two records? Make sure you have primary keys for your tables and your problems are gone. Along with a lot of other hard-to-trace anomalities ;) HTH /Kejpa
-
MySQL - Inserting multiple records at the same time.
kejpa replied to EFileTahi-A's topic in Database / XML / Reporting
No, there should be no problems of doing that. AFAIK is mySQL designed to be a multiuser database engine just like SQL server and unlike Access. /Kejpa -
Best I'm not sure of but I like SQLYog alot. Check out Webyog home page mySQL Ab is providing a free tool MySQLCC (MySQL Control Center) which I have installed but not used very much. /Kejpa
-
Thanx IngisKahn, it looks like it's going to fit.... Not so used to RegEx in VS (just used it with Perl & PHP) but I will make a go for it and promise to be back if I don't make it ;) Regards /Kejpa
-
Hi, I have quite a big piece of html that I need to change for clarity, some rows in the table needs high lightning and I thought I'd use som regex for that but from what I understand newlines mock things up... The pattern is.... a multiline string starting with <tr> and ending with </tr> containing PÅMINN or PÅMINN should be replaced with <tr class="highlight"> the complete string up to the ending </tr> ie should be.... TIA /Kejpa
-
Hi, when my SQL don't work as I was hoping for when building the string I always prints the resulting string (ie sql), copies it to an open GUI of the database where I run the query. It has two advantages, 1. when the sql is printed you can clearly see what's supposed to happen and solve many problems there 2. The database GUI gives you additional information about the query (I know you can print mysql_error in your app, but somehow it's more obvious in the GUI) HTH /Kejpa
-
I never rely purely on filenames such as better use the whole path HTH /Kejpa
-
Combo/List boxes and having an Item/Value relationship without databases
kejpa replied to Denaes's topic in Windows Forms
You can make a class like... Public Class cComboItem Private iValue As Integer Private sDisplay As String Public Overrides Function ToString() As String Return sDisplay End Function Public Sub New(ByVal Value As Integer, ByVal Display As String) iValue = Value sDisplay = Display End Sub Public ReadOnly Property Value() As Integer Get Return iValue End Get End Property Public ReadOnly Property Display() As String Get Return sDisplay End Get End Property End Class and then you just add to the proper combobox... cboHands.Items.Add(New cComboItem(0, "None")) cboHands.Items.Add(New cComboItem(1, "One")) cboHands.Items.Add(New cComboItem(2, "Two")) cboHands.Items.Add(New cComboItem(3, "Three")) cboHands.DisplayMember = "Display" cboHands.ValueMember = "Value" HTH /Kejpa