|
You're doing it. The default system.mdw file is used for every database you create.
Create a new workgroup file (mdw) and start access using this mdw file. Each database you create will use this mdw file for user and password info.
Grtz, Guus
|
|
|
|
|
I would like to know if there is a way of reading two excel sheets and comparing the second excel sheet to the first.
silly widdle wabbit
|
|
|
|
|
You can import Microsoft Exel Object to your application and with that componet you can do exel thins. You can search this site to find articles about it. I don't know which language do you use to give you a link. Also you can get a query from a exel file and interact with them as a table. Look for OpenDataSource in onlinw book for SQL Server.
Mazy
No sig. available now.
|
|
|
|
|
How can i conect to sql server database at web server?
I want to connect to sql server database at web server directly
to allow the user to view and modify the data i know i can use web service to
do that but i want to connect to db directly
how can i do that
thanks i advance.
|
|
|
|
|
In your connection string give a IP of your server instead of computer name.
Mazy
No sig. available now.
|
|
|
|
|
|
Is this on a web page? If the viewstate is off or the list not otherwise repopulated on a page refresh then there won't be anything to select (because ASP.NET is stateless and doesn't retain information from one page request to the next)
If it is in a WinForm application then I have never seen this behaviour.
--Colin Mackay--
EuroCPian Spring 2004 Get Together[^]
|
|
|
|
|
Thanks. I think it was a viewstate problem. Fiddled with a bunch of properties on the control, and it seems to be working fine now. It is a webform.
|
|
|
|
|
I am using this SQL query to insert into an access database using oleDbCommand:
INSERT INTO Events (ID, Code, Hour, Day, Location, Name, Cost) VALUES (0, 'code', '5:05 pm', '11/3/2004', 'loc', 'name', '23.56')
I keep getting an insert error, although when testing the query through Access it works fine. I have tried both using command parameters and hard-coding the data in as it is above, with the same results.
Any suggestions?
|
|
|
|
|
Here is the entire source that I have so far in this section:
ds = New DataSet
myCommand.Fill(ds, "Data")
id = ds.Tables("DATA").Rows.Count()
txtID.Text = id
strQuery = "INSERT INTO Events (ID, Code, Hour, Day, Location, Name, Cost) VALUES (" _
& Int(id) & ", '" _
& txtCode.Text & "', '" _
& txtTime.Text & "', '" _
& txtDate.Text & "', '" _
& txtLocation.Text & "', '" _
& txtName.Text & "', '" _
& txtCost.Text & "')"
cmd = New OleDbCommand(strQuery, myConnection)
cmd.ExecuteNonQuery()
|
|
|
|
|
The ID column, is Autonumeric ?
The Hour and Day Column, what type are they ?
Free your mind...
|
|
|
|
|
ID is standard number. Handling the increment in code.
All other columns are text.
|
|
|
|
|
I don't see nothing wrong with your select statement.
Did you check the size of the fields ?
What's the error description ?
Free your mind...
|
|
|
|
|
Are you repeating a value on a column that is indexed as primary key ?
Free your mind...
|
|
|
|
|
Uhhhm, no. And no. In fact, right now that table is empty. And everything is configured as a text value. I was really hoping it was the SQL, but now it looks like maybe the code itself. Or something else. Funny thing. That exact same code (with different fields and parameters) works perfectly in the same database, different table.
I'll have to look at it more thoroughly, I guess.
Thanks
|
|
|
|
|
One possibility is that Access requires literal date data to be set off by #, as in #11/03/2004#. This may apply to time values, as well, though Clippy won't tell me that no matter how hard I ask.
"Another day done - All targets met; all systems fully operational; all customers satisfied; all staff keen and well motivated; all pigs fed and ready to fly" - Jennie A.
|
|
|
|
|
Do you have a specific error message?
What is the schema definition of the Events table? (what are the field types and sizes for each field in the table)
Any identity/autogenerated columns? Is there primary key defined?
|
|
|
|
|
How can I get a list of tables from a SQL server database so that I can then display the list in a Repeater or DataList control? I would also like to get the Table Description property. My ultimate goal is to display my lookup tables (all begin with zlk) with hyperlinks that open forms for maintaining these tables.
|
|
|
|
|
select * from sysobjects where type='U' will return the tables...
Free your mind...
|
|
|
|
|
At my company, we have a SQL database that contains information about employees, clients, and other such administrative information. I'm developing an application that requires its own SQL database. One of the main tables has several fields that need to 'point' to valid records in the administration database, such as ClientID, for example.
How can I go about doing this? Can I add this somehow to my relationship diagram?
Thanks in advance.
Kyosa Jamie Nordmeyer - Cho Dan
Portland, Oregon, USA
|
|
|
|
|
MS SQL Server doesn't support creating relations to external datasources.
Though you are able to JOIN to external tables in a query.
Have a look at my latest article about Object Prevalence with Bamboo Prevalence.
|
|
|
|
|
Figures. Maybe that add that ability in Yukon. From a user standpoint, it seems like an obvious thing to include (my company can't be the first to want seperate databases for seprate needs), but who knows how tricky it is to program from Microsoft's side.
Oh well. Here's hoping for Yukon...
Kyosa Jamie Nordmeyer - Cho Dan
Portland, Oregon, USA
|
|
|
|
|
I am having trouble storing the date in UK format.
I have an aspx page with a DateTime Validator control - works ok.
If the Date Text field on the page is entered in US format: mm/dd/yyy my INSERT works fine. However iif the format is UK: dd/mm/yyyy, the INSERT fails.
So i got to thinking i should be formatting the date myself after it passes through the Validator.
i tried the code below:
dt = Convert.ToDateTime(txtBirth.Text);
output = dt.ToString("d",DateTimeFormatInfo.InvariantInfo);
values.Add("'" + output + "'");
Is this the correct approach? (full listing shown below)
If i do: //values.Add("'" + txtBirth.Text + "'");
and the Date is in US format it works fine, but fails for UK.
your help would be greatly appreciated...
Carl
Full Listing + stuff i've tried:
SqlConnection con;
string sql;
SqlCommand cmd;
StringBuilder sb = new StringBuilder();
ArrayList values = new ArrayList();
sb.Append("INSERT INTO [Users] ");
sb.Append("(UserID,Login,Password,FirstName,LastName,PhoneNumber,Email,Address,");
sb.Append(" MobileNumber, DateOfBirth,IsAdministrator) ");
sb.Append("VALUES ('{0}', '{1}', '{2}', '{3}','{4}','{5}','{6}','{7}','{8}',{9},{10})");
values.Add(Guid.NewGuid().ToString() );
values.Add(txtUser.Text);
values.Add(txtPwd.Text);
values.Add(txtFName.Text);
values.Add(txtLName.Text);
values.Add(txtPhone.Text);
values.Add(txtEmail.Text);
//values.Add(0);
if(txtBirth.Text != string.Empty)
{
//test vars
string output="No Output";
DateTime dt;
dt = Convert.ToDateTime(txtBirth.Text);
output = dt.ToString("d",DateTimeFormatInfo.InvariantInfo);
values.Add("'" + output + "'");
//Test Blocks
//block 1
//DateTime dtNow = DateTime.Now;
//values.Add("'" + dtNow + "'");
//block 2
//values.Add("'" + txtBirth.Text + "'");
//block 3
//values.Add("'27/11/1999'");
//block 4
//storing the date & time local to the client
//DateTime dt;
//dt = DateTime.Now;
//string output = dt.ToString("G",DateTimeFormatInfo.CurrentInfo);
//values.Add("'" + dt + "'");
//block 5
//dt = Convert.ToDateTime(txtBirth.Text);
//output = dt.ToString("d",DateTimeFormatInfo.InvariantInfo);
//values.Add("'" + output + "'");
//block 6
//values.Add("'" + txtBirth.Text + "'");
//test stuff
Label1.Text = output;
}
else
values.Add("Null");
|
|
|
|
|
I suggest either using DateTime.Parse, or using separate entry fields for day, month and year.
|
|
|
|
|
I suggest use Globalization Classes in .Net
using System.Globalization<br />
using System.Threading<br />
in page load
<br />
string slang = Request.UserLanguages[0];<br />
Thread.CurrentThread.CurrentCulture = new CultureInfo(slang);<br />
With this code according to user preferences you should be able to save datetime properly. If user is american it expect american style, if it is turkish then it expects turkish style. Request.UserLanguages[0] gives you a
string in this format
en-UK or en-US
first two chars is about language
second two chars is about culture.
You can check user culture and call different function according to that also.
Education is no substitute for intelligence. That elusive quality is defined only in part by puzzle-solving ability. It is in the creation of new puzzles reflecting what your senses report that you round out the definition. Frank Herbert
|
|
|
|