如何解决从.netcore 3.1连接到MS Access MDB文件
我正在尝试使用.netcore 3.1连接到MDB文件。
我尝试使用oledb,但我认为它不起作用,因为我的电脑是Windows 10。
我尝试使用odbc,但出现以下错误。<template>
<div class="container">
<div
:class="containerClass"
:style="containerStyle"
@pointerdown="pointerDownHandler"
@pointermove="pointerMoveHandler"
@pointerup="pointerUpHandler"
@pointerover="reportEvent"
@pointerenter="reportEvent"
@pointercancel="reportEvent"
@pointerout="reportEvent"
@pointerleave="reportEvent"
@gotpointercapture="reportEvent"
@lostpointercapture="reportEvent"
@transitionend="transitionendHandler"
class="card"
>
<svg viewBox="0 0 100 20" always-swipeable="true" class="drag-handle">
<polyline points="27,10 73,10" stroke-linecap="round"></polyline>
</svg>
<div class="scrollBox" ref="scrollBox">
<div :key="item" class="item" v-for="item in items">
{{ item }}
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
deltaY: 0,isDraggingByHandle: false,isTransitioning: false,items: [
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,],offsetHeight: 0,scrollBoxHeight: 0,scrollTop: 0,touchAction: null,verticalStates: [
{
translateY: 0,},{
translateY: window.innerHeight - 200,verticalStateIndex: 0,};
},computed: {
activeVerticalState() {
return this.verticalStates[this.verticalStateIndex];
},containerClass() {
return {
"show-scrollbar": this.isScrollable,transition: this.isTransitioning,};
},containerStyle() {
return {
transform: `translateY(${this.translateY}px)`,isAnySwipeAllowed() {
return this.isDraggingByHandle || !this.isScrollable;
},isExpanded() {
return this.verticalStateIndex === 0;
},isScrollable() {
return this.isExpanded && this.scrollHeight > this.offsetHeight;
},isSwipeDown() {
return (
this.deltaY > 0 && (this.isAnySwipeAllowed || this.scrollTop === 0)
);
},isSwipeUp() {
return (
this.deltaY < 0 &&
(this.isAnySwipeAllowed ||
this.offsetHeight + this.scrollTop === this.scrollHeight)
);
},scrollBox() {
return this.$refs.scrollBox;
},translateY() {
let translateY = this.activeVerticalState.translateY;
if (
this.touchAction === "verticalSwipe" &&
(this.isSwipeDown || this.isSwipeUp)
) {
translateY = translateY + this.deltaY;
}
return translateY;
},mounted() {
this.updateScrollBoxData();
},methods: {
pointerDownHandler: function ({ clientY,target,pointerId }) {
console.log("pointerdown",pointerId);
target.setPointerCapture(pointerId);
this.updateScrollBoxData();
this.isDraggingByHandle = Boolean(
target.getAttribute("always-swipeable")
);
this.touchStartClientY = clientY;
this.touchAction = "tap";
},pointerMoveHandler: function ({ clientY,pointerId }) {
console.log("pointermove",pointerId,this.deltaY);
this.deltaY = clientY - this.touchStartClientY;
// promote touchAction to swipe or scroll depending on deltas and other variables
if (this.touchAction === "tap") {
if (this.isSwipeDown || this.isSwipeUp) {
this.touchAction = "verticalSwipe";
} else {
this.touchAction = "scroll";
this.updateScrollBoxData();
}
}
},pointerUpHandler: function ({ target,pointerId }) {
console.log("pointerup",pointerId);
target.releasePointerCapture(pointerId);
switch (this.touchAction) {
case "tap":
if (!this.isExpanded) {
this.verticalStateIndex = Math.max(this.verticalStateIndex - 1,0);
this.isTransitioning = true;
}
break;
case "verticalSwipe":
if (this.isSwipeDown) {
this.verticalStateIndex = Math.min(
this.verticalStateIndex + 1,this.verticalStates.length - 1
);
} else if (this.isSwipeUp) {
this.verticalStateIndex = Math.max(this.verticalStateIndex - 1,0);
}
this.isTransitioning = true;
this.deltaY = 0;
break;
}
},reportEvent({ type,pointerId }) {
console.log(type,pointerId);
},transitionendHandler() {
this.touchAction = null;
this.isTransitioning = false;
this.updateScrollBoxData();
},updateScrollBoxData() {
const { scrollHeight,offsetHeight,scrollTop } = this.scrollBox;
this.offsetHeight = offsetHeight;
this.scrollHeight = scrollHeight;
this.scrollTop = scrollTop;
},};
</script>
<style lang="scss" scoped>
.container {
display: flex;
justify-content: center;
margin-top: 5vh;
overflow: hidden;
touch-action: none;
.card {
pointer-events: all;
width: 90vw;
height: 100%;
touch-action: none;
&.transition {
transition: transform 0.15s ease-out;
}
.drag-handle {
stroke-width: 5px;
stroke: #bfbfc0;
width: 100%;
height: 30px;
background: pink;
}
.scrollBox {
overflow-y: hidden;
pointer-events: none;
background: green;
height: 85vh;
.item {
margin-bottom: 20px;
height: 150px;
font-size: 36px;
background: yellow;
}
}
&.show-scrollbar .scrollBox {
overflow-y: scroll;
pointer-events: all;
}
}
}
</style>
我的PC上安装了Office 365 32位。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。