|
Hi All.
I was wondering if someone could answer a question that was originally asked here[^] two weeks ago as I have not yet recieved an answer.
I am stumped as to what to do to get this to work
Will it help if I get on my knees and beg?
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
Access supports incremental primary keys - they're of type "Counter" (or is it "Count"?)
When you're inserting into a counter field, leave it out of your SQL statement and Access will do the rest.
Dave
ps. Begging not required
|
|
|
|
|
Hi,
I have over a million images of average size 200 KB.My Web- based app would provide facility to view these images.Would you suggest to store these images in MS SQL server or database as oppose to File Server ? What are the advantages/disadvantages of storing images in database.
|
|
|
|
|
Images stored in a database tend to be much slower to access than images stored in the file system. Store the images on disk - preferably split over multiple directories, as Windows sometimes has problems with huge numbers of files in one directory - and store the path to the image in the database.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
There's a type called image that is designed for this purpose. It's not real robust though. Most people work out some mechanism of storing images in a file system and storing a path to them. Other RDBMS's have types for this purpose as well (BFILE in Oracle)
Mark Conger
Sonork:100.28396
|
|
|
|
|
I'd have to agree that storing the paths in the database would be the best apporach. At this point you should probably think of a way to programatically grab the paths and file names and insert them in the table you have.
-Ra
There are 10 types of people in the world: Those who understand binary, and those who don't...
|
|
|
|
|
Based on the responses I received I am planning to use Filesystem to store files and store paths into database.But I wonder why would someone want to store images in database.One reason anyone can think of is security but than there are ways to secure files also and if I am getting performance hit I better take care of link brakage and use filesystem.(FYI even though I have over million images only 200-2000 will be accessed at a time.)
:-:-:-:
Everything happens for a reason, but not that everything that happens has a reason.(I don't know what I am talking about, do you ? )
|
|
|
|
|
Hi all,
Can someone tell me how to declare a variable and in the WHERE clause say field > variable.
The variable must be in the form 12:25 i.e. time format.
Also the variable is user input from a form in a .asp page.
Here is the query:
Statement=request.form("input1")
Sql = "SELECT First.Time FROM First WHERE First.Time > 'Statement%'";
"Statement" accepts the variable fine but when I use it in the Sql statement it will not work. I really don't know how to use variables in Sql statements.
Please help me
Damien Lynch
|
|
|
|
|
Damien,
You are almost there. Try:
Sql = "SELECT First.Time FROM First WHERE First.Time > '" + Statement + "%'";
- Paul
|
|
|
|
|
Hi,
I want to know if its possible, with the same SqlCommand, first execute a ExecuteNonQuery(), and then change the SqlCommand.Text and execute an ExecuteReader().... because it doesn´t work.
When I try to do the same, but with two different SqlCommand objects, it doen´s work again. The ExecuteReader trhows an exeption.... what should I do? Do I have to close the connection and then open it again?
Many thanks in advance!
|
|
|
|
|
simon29 wrote:
Do I have to close the connection and then open it again?
Should not have to, I have re-used SqlCommand objects before.
Post your code, then we can help.
Paul Watson Bluegrass Cape Town, South Africa Christopher Duncan wrote:
Which explains why when Santa asked, "And what do you want for Christmas, little boy?" I said, "A life." (Accesories sold separately)
|
|
|
|
|
hello @all,
i connected my mfc program and an access database with ODBC.
<br />
CDatabase db;<br />
db.Open(_T( "MyDatabase" ), FALSE,<br />
FALSE, _T( "ODBC"));
the ODBC driver of my database is called 'MyDatabase'. but when i use this code, the database is not selected. i must select it myself!
what must i change to select my odbc driver from the program (i have to do nothing, after i start the program)?
thanks
mfc
|
|
|
|
|
Greetings,
I have been trying to use the "sp_tables" procedure from ADO, and it seems to return a recordset with the count of "0". I am working with
the VC++ .Net studio under windows 2000.
I am connected to the sql server with "no" intial catolog using ADO.
I have a database within the system called "MyTestDB", and I tried
to access the tables from within the database but I get a recordset
of "0" count.
I can however use the "SQL Enterprise Manager" to send the command
and get a listing of my tables, but for some reason ADO just isn't
working correctly.
Here is a sample of the sql code I am using.
----------------------------------------
USE MyTestDB EXEC sp_tables
Any ideas, or suggestions?
Thanks in advance for any help!
|
|
|
|
|
rather do this (C# but should be readable)
sqlConnection.Open();
sqlConnection.ChangeDatabase("MyTestDB");
then setup a SqlCommand to handle the stored procedure like you did in the sp_databases run it while the connection is open. I dont think a dataadapter will work here. Just loop thru the SqlDataReader...or fixed the connection string
Cheers
DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET
|
|
|
|
|
Hello,
Thanks for your response.
It seems that the current database interface that I am using is ADO 2.6, and I can't use "ChangeDatabase"
which is not in that interface.
Is there a way to do this in the older versions of ADO?
|
|
|
|
|
|
Try EXEC MyTestDB.dbo.sp_tables
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Hello,
The "EXEC MyTestDB.dbo.sp_tables" WORKED!!!
Thanks that is exactly what I needed.
|
|
|
|
|
Hi *.*!
I don't seem to figure out how to store an Image in the database. I have thumbnail-sized images (up to 5k) and need to store them. What db-datatype should I use? How can I effectively read and write the value?
Thanks in advance!
Matthias
In theory, there is no difference between theory and practice. In practice, however, there is.
(unknown author)
|
|
|
|
|
http://codeproject.com/cs/database/albumviewer.asp[^]
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Thanks!
Matthias
In theory, there is no difference between theory and practice. In practice, however, there is.
(unknown author)
|
|
|
|
|
Hi, ALL. There is a small problem. A have two tables in master-detail relationships (farther-child). Master table is bound to DataView object. How can I apply filtering conditions on the child table. In other words, how can I refer to child table within RowFilter string.
|
|
|
|
|
Hello,
I was wondering what the best way to check if a database exists, so it can be created if it doesn't in SQL server?
Right now I just use a try catch block, and see if it fails, but is there a better way since the "_com_error &e" try catch shows the same hresult on all sql errors when using Visual C++ .Net.
Thanks in advance for any help!!
|
|
|
|
|
|
Excellant that is exactly what I needed!! Thanks, it worked great!
Thanks again!!!
|
|
|
|