PDA

View Full Version : چرا رکوردهای پایگاه داده من حذف نمی شوند ؟



Alen
دوشنبه 23 شهریور 1388, 11:34 صبح
سلام دوستان
من با استفاده از access 2007 و VB.NET 2008 کدی برای حذف رکورد های پایگاه داده بصورت زیر نوشته ام


oledbconnection.Open()
oledbcommand.CommandText = "delete from Mojoudi where MojoudiUnit='" + TextBox1.Text.Trim() + "' and MojoudiYear='" + TextBox2.Text.Trim() + "' and MojoudiMounth='" + TextBox3.Text.Trim() + "';"
oledbcommand.ExecuteNonQuery()
oledbconnection.Close()

مشکل اینه که این query از داخل خود access درست عمل میکنه اما اینجا هیچ رکوردی رو حذف نمی کنه
اگه ممکنه منو راهنمایی بفرمایید

Hesamzadeh
دوشنبه 23 شهریور 1388, 20:35 عصر
خوب چرا از ویزارد دیتاست برای این منظور استفاده نمیکنی؟

maXXis
دوشنبه 23 شهریور 1388, 21:36 عصر
فکر کنم جای & توی دستور SQL خالیه.

Alen
سه شنبه 24 شهریور 1388, 14:44 عصر
ممنون بچه ها مشکلم حل شد
مشکل از این نکته بود که در Acess 2007 باید برای داشتن کنترل کامل بر روی DB مسیری که DB در اون قرار داره به عنوان یه مسیر trust معرفی بشه به نحو زیر


Specify a trusted location
In the Message Bar, click Options.
At the bottom of the Microsoft Office Security Options dialog box, click Open the Trust Center.
In the left pane of the Trust Center dialog box, click Trusted Locations.
To add a network location, in the right pane, select the Allow Trusted Locations on my network check box.
Click Add new location.
In the Microsoft Office Trusted Location dialog box, do one of the following:
In the Path box, type the full path of the location that you want to add.
Click Browse to browse to the location.
To specify that subfolders of the new trusted locations should also be trusted, select the Subfolders of this location are also trusted check box.
Optionally, in the Description box, type a description for the trusted location.

maXXis
سه شنبه 24 شهریور 1388, 15:10 عصر
پس جای & خالی نبود.:اشتباه: