|
-
Jun 9th, 2002, 03:03 PM
#1
Thread Starter
<?="Moderator"?>
C#, CGI and databases
hey, im using C# to write to databases, i can do it though a normal exe normal but when i try and do it though a web page cgi and stuff, it just comes up with an error
System.Data.OleDb.OleDbException: Operation must use an updateable query.
-
Jun 10th, 2002, 12:11 PM
#2
it might be that the database is read only and/or the server is not setup to use an access database...
..Im assuming you are using an access database..
-
Jun 10th, 2002, 02:12 PM
#3
Thread Starter
<?="Moderator"?>
im using an access database. i can read write and do every thing to it normaly. but when i try to do it though my server it doesnt work? do i have to set the server up to let C# write though the server, coz it can read from it, but it can write?
-
Jun 10th, 2002, 02:30 PM
#4
is this server remote...or yours?
-
Jun 10th, 2002, 02:32 PM
#5
Thread Starter
<?="Moderator"?>
yer its hosted on my own computer and im running wun2k SP2
-
Jun 10th, 2002, 02:34 PM
#6
make sure that your web application virtual directory is set up with write permissions.
-
Jun 10th, 2002, 03:07 PM
#7
Thread Starter
<?="Moderator"?>
ypu the persmission are set to read, write and the execute permission are set to scripts and exectuables.
-
Jun 10th, 2002, 03:23 PM
#8
hmm..well I am out of ideas and am about to leave work..If I come up with anything tonight, ill let you know.
-
Jun 10th, 2002, 03:36 PM
#9
Thread Starter
<?="Moderator"?>
thanks any way
-
Jun 14th, 2002, 10:10 AM
#10
What is the error your getting?
-
Jun 14th, 2002, 11:11 AM
#11
Thread Starter
<?="Moderator"?>
Error Type:
Microsoft JET Database Engine (0x80004005)
Operation must use an updateable query.
its not the code, because ive tryed it using VB asp and none of them will work when i try to write it though my webserver?
-
Jun 14th, 2002, 11:33 AM
#12
Hmm it should be writing some error to the browser..? Does it not display anything?
-
Jun 14th, 2002, 01:33 PM
#13
Thread Starter
<?="Moderator"?>
sorry, it displays that in the browser with some other stuff, but when i run it from a folder normaly theres no problems? could it be something with IIS?
-
Aug 22nd, 2002, 02:11 AM
#14
Send me your code and db I will try to test it over here.
rgds,
abhijit
-
Sep 2nd, 2002, 07:08 AM
#15
Thread Starter
<?="Moderator"?>
ive sorted it out now it was something to do with the IIS user config, they didn't have the access rights.
thanks
-
Sep 3rd, 2002, 05:41 PM
#16
Lively Member
Hey John,
Could you perhaps post the code your using to connect to the database? It seems like it might do what i need(to mysql).
Thanks,
-toto
-
Sep 4th, 2002, 11:11 AM
#17
Thread Starter
<?="Moderator"?>
i used mdb, and it was compiled to a exe
Code:
using System.Data.OleDb;
class zzz
{
public static void Main()
{
try
{
OleDbConnection s;
s = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:\\c#\\myDB.mdb");
s.Open();
OleDbCommand c;
string t;
t=System.Environment.GetEnvironmentVariable("QUERY_STRING");
//t = "aa=john&bb=tindell";
string [] u;
char [] v = new char[2];
v[0] = '=';
v[1] = '&';
u = t.Split(v);
string f1,f2,f3;
f1 = u[1].Replace('+',' ');
f2 = u[3].Replace('+',' ');
f3 = "insert into bbb values('" + f1 + "','" + f2 + "')";
System.Console.WriteLine("Content-Type:text/html\n");
System.Console.WriteLine(f3);
c=new OleDbCommand(f3,s);
c.ExecuteNonQuery();
}
catch(System.Exception e)
{
System.Console.WriteLine(e.ToString());
}
}
}
-
Jan 4th, 2006, 08:09 PM
#18
Member
Re: C#, CGI and databases
hey, do you know how to handle a file upload?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|