PDA

View Full Version : مشکل در آپدیت شدن دیتابیس روی سرور



ehsan2007
پنج شنبه 29 شهریور 1386, 02:20 صبح
سلام به استادان و دوستان عزیز سایت
من صفحه asp.net فرستادم روی هاست همش درسته فقط به کد تغییر در دیتابیس اکسس که میرسه توی صفحه ارور Runtime Error میده همه کدهای قبلیشو که شرط و حلقه درست کار میکنن ولی به کد آپدیت یا insert که میرسه ارور میده حالا من فکر میکنم توی پوشه web.config
تغییراتی ایجاد کنم برای آپدیت کردن دیتا بیس لطفا کمکم کنید توی کامپیوتر خودم همه کارا درست انجام میشه و دیتابیس جدول بهش اضافه میشه ولی روی هاست ارور میده
اینم کد برای اضافه کردن جدول که روی کامپیوتر خودم درست کار میکنه


Dim insertsql AsString
insertsql = "INSERT INTO box(email,pas,name,link,name2,ip,id)"
insertsql &= " VALUES('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox4.Text & "','" & TextBox3.Text & "','" & TextBox5.Text & "','" & ClientIPAdress & "','" & 0 & "')"
con = New OleDbConnection(strcon)
cmd = New OleDbCommand(insertsql, con)
con.Open()
cmd.ExecuteNonQuery()
con.Close()

mp2009
پنج شنبه 29 شهریور 1386, 10:34 صبح
باید connectionString رو تغییر بدی

ehsan2007
پنج شنبه 29 شهریور 1386, 11:01 صبح
منظورتون چیه دوست عزیز

ehsan2007
پنج شنبه 29 شهریور 1386, 11:07 صبح
توی فایل web.config باید این کارو بکنم چه کدیرو باید عوض کنم توش که فقط بسته شدن تگه
<connectionStrings/>

Nightbat
پنج شنبه 29 شهریور 1386, 12:37 عصر
توی کدت strcon رو از کجا می آری؟ اشکال از اونه.( احتمالا !)

ehsan2007
پنج شنبه 29 شهریور 1386, 13:01 عصر
strcon استرینگ اتصال به دیتابیس حتی آوردم مستقیم بدون استرینگم ربط دادم بهش نشد

strcon = ("provider=microsoft.jet.oledb.4.0;Data Source=" & Server.MapPath("box.mdb"))


تورو خدا کمکم کنید 2 هفتست دارم برنامه مینویسم ولی الان آخرش توی سایت خراب شده توی کامپیوتر خودم همش درسته من دیتابیسم که اکسس روی هاست کپی میگرم اشکال از اون که نیست
شاید باید با کنترل پنل هاستم دیتابیس اکس بسازم چیکار کنم
تورو خدا کمکم کنید

ehsan2007
پنج شنبه 29 شهریور 1386, 21:43 عصر
روی هاست که اکسس میزارم فقط خوندنی میشه دیگه نه آپدیت میشه نه جدول جدیدی بهش اضافه میشه توی تاپیکها خیلی گشتم اینو پیدا کردم منظورشونو نفهمیدم
نوشته بودن

شما دسترسی write ندارید باید مجوز write رو بدید
از user زیر استفاده کنید
IUSR_Computer_Name

Open the file explorer
Tools menu
Options menu
Click the [View] tab
Uncheck "Use simple file sharing"
Click OK
Find the folder in which your MDB file is kept
Right-click the folder
Select "Sharing and security"
Click the [Security] tab
Click the Add button
Click the Advanced button
Click the Find Now button
Select the ASPNET user and click OK
In the checkboxes at the bottom of the form, give this user Full Control
شما حتما خط آخر را باید رعایت کنید

اخرم گفته بود این کارو کردم که درست شد ولی معلوم نیست چیرو گفته

من از این روش استفاده کردم و شد .
روی فولدر کلیک راست کردم . در گزینه Web Sharing روی گزینه Share this folder تیک زدم . حل شد

منون میشم کسی کمکم کنه

ehsan2007
پنج شنبه 29 شهریور 1386, 23:01 عصر
کی از استادان نیست جواب مارو بده یا تا میبینید تازه کارم میگید ولش کن سوال الکی میکنه
با یکم دست کاری و خاموش کردن ارور توی web.config حالا این ارورو میده


Server Error in '/' Application.

Operation must use an updateable query.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Operation must use an updateable query.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:

[OleDbException (0x80004005): Operation must use an updateable query.] System.Data.OleDb.OleDbCommand.ExecuteCommandTextF orSingleResult(tagDBPARAMS dbParams, Object& executeResult) +257 System.Data.OleDb.OleDbCommand.ExecuteCommandText( Object& executeResult) +194 System.Data.OleDb.OleDbCommand.ExecuteCommand(Comm andBehavior behavior, Object& executeResult) +56 System.Data.OleDb.OleDbCommand.ExecuteReaderIntern al(CommandBehavior behavior, String method) +105 System.Data.OleDb.OleDbCommand.ExecuteNonQuery() +103 _Default.Button1_Click(Object sender, EventArgs e) +2322 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105 System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument) +107 System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210


این ارور از چیه